|
@@ -3,7 +3,9 @@ package main |
|
@@ -3,7 +3,9 @@ package main |
|
3
|
import (
|
3
|
import (
|
|
4
|
"fmt"
|
4
|
"fmt"
|
|
5
|
"github.com/beego/beego/v2/server/web"
|
5
|
"github.com/beego/beego/v2/server/web"
|
|
|
|
6
|
+ "github.com/linmadan/egglib-go/log/logrus"
|
|
6
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/constant"
|
7
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/constant"
|
|
|
|
8
|
+ _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/constant"
|
|
7
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
|
9
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/pg"
|
|
8
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/redis"
|
10
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/infrastructure/redis"
|
|
9
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/log"
|
11
|
"gitlab.fjmaimaimai.com/allied-creation/allied-creation-user/pkg/log"
|
|
@@ -11,7 +13,13 @@ import ( |
|
@@ -11,7 +13,13 @@ import ( |
|
11
|
)
|
13
|
)
|
|
12
|
|
14
|
|
|
13
|
func main() {
|
15
|
func main() {
|
|
14
|
- log.Logger.Info("server start!")
|
16
|
+ log.Logger.Info("server start ....")
|
|
15
|
log.Logger.Info(fmt.Sprintf("ENABLE_KAFKA_LOG:%v", constant.ENABLE_KAFKA_LOG))
|
17
|
log.Logger.Info(fmt.Sprintf("ENABLE_KAFKA_LOG:%v", constant.ENABLE_KAFKA_LOG))
|
|
|
|
18
|
+
|
|
|
|
19
|
+ if constant.ENABLE_KAFKA_LOG {
|
|
|
|
20
|
+ w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOST, constant.TOPIC_LOG_STASH, false)
|
|
|
|
21
|
+ log.Logger.AddHook(w)
|
|
|
|
22
|
+ }
|
|
|
|
23
|
+ log.Logger.Info("server start!")
|
|
16
|
web.Run()
|
24
|
web.Run()
|
|
17
|
} |
25
|
} |