kafka.go
542 字节
package constant
import "os"
// kafka 地址
var KAFKA_HOSTS = "192.168.0.250:9092,192.168.0.251:9092,192.168.0.252:9092"
// kafka topic log stash
var TOPIC_LOG_STASH = "go_stash_dev"
// 是否启用日志收集 (本地不启用)
var ENABLE_KAFKA_LOG = false
func init() {
//if os.Getenv("KAFKA_HOSTS") != "" {
// KAFKA_HOSTS = os.Getenv("KAFKA_HOSTS")
//}
//if os.Getenv("TOPIC_LOG_STASH") != "" {
// POSTGRESQL_PORT = os.Getenv("TOPIC_LOG_STASH")
//}
if os.Getenv("ENABLE_KAFKA_LOG") != "" {
ENABLE_KAFKA_LOG = true
}
}