正在显示
1 个修改的文件
包含
10 行增加
和
2 行删除
1 | package main | 1 | package main |
2 | 2 | ||
3 | import ( | 3 | import ( |
4 | + "fmt" | ||
4 | "github.com/astaxie/beego" | 5 | "github.com/astaxie/beego" |
6 | + "gitlab.fjmaimaimai.com/mmm-go/gocomm/config" | ||
5 | "gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log" | 7 | "gitlab.fjmaimaimai.com/mmm-go/gocomm/pkg/log" |
8 | + "openapi/internal/utils" | ||
6 | _ "openapi/routers" | 9 | _ "openapi/routers" |
7 | "time" | 10 | "time" |
8 | ) | 11 | ) |
9 | 12 | ||
10 | func init() { | 13 | func init() { |
11 | time.Local = time.FixedZone("CST", 3600*8) | 14 | time.Local = time.FixedZone("CST", 3600*8) |
15 | + log.InitLog(config.Logger{ | ||
16 | + Filename: beego.AppConfig.String("aliyun_logs_access"), | ||
17 | + Level: fmt.Sprintf("%v", utils.ResolveLogLevel(beego.AppConfig.String("log_level"))), | ||
18 | + }) | ||
12 | } | 19 | } |
13 | 20 | ||
14 | func main() { | 21 | func main() { |
15 | defer func() { | 22 | defer func() { |
16 | - log.Info("app on stop!") | 23 | + log.Info("open-api on stop!") |
17 | }() | 24 | }() |
18 | - log.Info("app on start!") | 25 | + |
26 | + log.Info("open-api on start!") | ||
19 | log.Info("Beego Run Mode:", beego.BConfig.RunMode) | 27 | log.Info("Beego Run Mode:", beego.BConfig.RunMode) |
20 | 28 | ||
21 | beego.Run() | 29 | beego.Run() |
-
请 注册 或 登录 后发表评论