作者 yangfu

日志修改

... ... @@ -58,6 +58,8 @@ spec:
value: "1"
- name: ERROR_BASE_CODE_MULTIPLE
value: "1000"
- name: ENABLE_KAFKA_LOG
value: "true"
- name: USER_MODULE_HOST
value: "http://allied-creation-user-dev.fjmaimaimai.com"
- name: REDIS_HOST
... ...
... ... @@ -2,11 +2,20 @@ package main
import (
"github.com/beego/beego/v2/server/web"
"github.com/linmadan/egglib-go/log/logrus"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg"
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego"
)
func main() {
// web主服务
if constant.ENABLE_KAFKA_LOG {
w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)
log.Logger.AddHook(w)
}
web.Run()
}
... ...
... ... @@ -3,7 +3,7 @@ package constant
import "os"
// kafka 地址
var KAFKA_HOSTS = ""
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"
... ...