正在显示
5 个修改的文件
包含
12 行增加
和
1 行删除
@@ -69,6 +69,8 @@ spec: | @@ -69,6 +69,8 @@ spec: | ||
69 | value: "https://suplus-worth-app-gateway-dev.fjmaimaimai.com" | 69 | value: "https://suplus-worth-app-gateway-dev.fjmaimaimai.com" |
70 | - name: MMM_OPEN_API_SERVICE_HOST | 70 | - name: MMM_OPEN_API_SERVICE_HOST |
71 | value: "http://mmm-open-api-dev.fjmaimaimai.com" | 71 | value: "http://mmm-open-api-dev.fjmaimaimai.com" |
72 | + - name: LOG_PREFIX | ||
73 | + value: "[mmm-worth_dev]" | ||
72 | volumes: | 74 | volumes: |
73 | - name: accesslogs | 75 | - name: accesslogs |
74 | emptyDir: {} | 76 | emptyDir: {} |
@@ -72,6 +72,8 @@ spec: | @@ -72,6 +72,8 @@ spec: | ||
72 | value: "https://suplus-worth-app-gateway-prd.fjmaimaimai.com" | 72 | value: "https://suplus-worth-app-gateway-prd.fjmaimaimai.com" |
73 | - name: MMM_OPEN_API_SERVICE_HOST | 73 | - name: MMM_OPEN_API_SERVICE_HOST |
74 | value: "https://public-interface.fjmaimaimai.com/openapi" | 74 | value: "https://public-interface.fjmaimaimai.com/openapi" |
75 | + - name: LOG_PREFIX | ||
76 | + value: "[mmm-worth_prd]" | ||
75 | volumes: | 77 | volumes: |
76 | - name: accesslogs | 78 | - name: accesslogs |
77 | emptyDir: {} | 79 | emptyDir: {} |
@@ -69,6 +69,8 @@ spec: | @@ -69,6 +69,8 @@ spec: | ||
69 | value: "https://suplus-worth-app-gateway-test.fjmaimaimai.com" | 69 | value: "https://suplus-worth-app-gateway-test.fjmaimaimai.com" |
70 | - name: MMM_OPEN_API_SERVICE_HOST | 70 | - name: MMM_OPEN_API_SERVICE_HOST |
71 | value: "http://mmm-open-api-test.fjmaimaimai.com" | 71 | value: "http://mmm-open-api-test.fjmaimaimai.com" |
72 | + - name: LOG_PREFIX | ||
73 | + value: "[mmm-worth_test]" | ||
72 | volumes: | 74 | volumes: |
73 | - name: accesslogs | 75 | - name: accesslogs |
74 | emptyDir: {} | 76 | emptyDir: {} |
@@ -9,6 +9,7 @@ var MMM_OPEN_API_SERVICE_HOST = "http://mmm-open-api-dev.fjmaimaimai.com" | @@ -9,6 +9,7 @@ var MMM_OPEN_API_SERVICE_HOST = "http://mmm-open-api-dev.fjmaimaimai.com" | ||
9 | 9 | ||
10 | var LOG_LEVEL = "debug" | 10 | var LOG_LEVEL = "debug" |
11 | var LOG_File = "logs/app.log" | 11 | var LOG_File = "logs/app.log" |
12 | +var LOG_PREFIX = "[mmm-worth_dev]" | ||
12 | 13 | ||
13 | func init() { | 14 | func init() { |
14 | if os.Getenv("LOG_LEVEL") != "" { | 15 | if os.Getenv("LOG_LEVEL") != "" { |
@@ -20,4 +21,7 @@ func init() { | @@ -20,4 +21,7 @@ func init() { | ||
20 | if os.Getenv("MMM_OPEN_API_SERVICE_HOST") != "" { | 21 | if os.Getenv("MMM_OPEN_API_SERVICE_HOST") != "" { |
21 | MMM_OPEN_API_SERVICE_HOST = os.Getenv("MMM_OPEN_API_SERVICE_HOST") | 22 | MMM_OPEN_API_SERVICE_HOST = os.Getenv("MMM_OPEN_API_SERVICE_HOST") |
22 | } | 23 | } |
24 | + if os.Getenv("LOG_PREFIX") != "" { | ||
25 | + LOG_PREFIX = os.Getenv("LOG_PREFIX") | ||
26 | + } | ||
23 | } | 27 | } |
@@ -2,7 +2,7 @@ | @@ -2,7 +2,7 @@ | ||
2 | 2 | ||
3 | //var Logger log.Logger | 3 | //var Logger log.Logger |
4 | 4 | ||
5 | -// TODO 日志输出 | 5 | +// 日志输出 |
6 | //func init() { | 6 | //func init() { |
7 | // Logger = logrus.NewLogrusLogger() | 7 | // Logger = logrus.NewLogrusLogger() |
8 | // Logger.SetServiceName(constant.SERVICE_NAME) | 8 | // Logger.SetServiceName(constant.SERVICE_NAME) |
@@ -51,6 +51,7 @@ func NewBeegoLogger(conf LoggerConfig) *logs.BeeLogger { | @@ -51,6 +51,7 @@ func NewBeegoLogger(conf LoggerConfig) *logs.BeeLogger { | ||
51 | log.SetLevel(ilv) | 51 | log.SetLevel(ilv) |
52 | log.EnableFuncCallDepth(true) | 52 | log.EnableFuncCallDepth(true) |
53 | log.SetLogFuncCallDepth(5) | 53 | log.SetLogFuncCallDepth(5) |
54 | + log.SetPrefix(constant.LOG_PREFIX) | ||
54 | return log | 55 | return log |
55 | } | 56 | } |
56 | 57 |
-
请 注册 或 登录 后发表评论