|
@@ -2,11 +2,20 @@ package main |
|
@@ -2,11 +2,20 @@ 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-cooperation/pkg/constant"
|
|
|
7
|
+ _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/constant"
|
5
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg"
|
8
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg"
|
|
|
9
|
+ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
|
|
|
10
|
+ _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
|
6
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego"
|
11
|
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego"
|
7
|
)
|
12
|
)
|
8
|
|
13
|
|
9
|
func main() {
|
14
|
func main() {
|
10
|
// web主服务
|
15
|
// web主服务
|
|
|
16
|
+ if constant.ENABLE_KAFKA_LOG {
|
|
|
17
|
+ w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)
|
|
|
18
|
+ log.Logger.AddHook(w)
|
|
|
19
|
+ }
|
11
|
web.Run()
|
20
|
web.Run()
|
12
|
} |
21
|
} |