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