File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 44 _ "embed"
55 "fmt"
66 "os"
7+ "time"
78
89 "github.com/cortexapps/axon/common"
910 "github.com/cortexapps/axon/config"
@@ -13,6 +14,7 @@ import (
1314 "go.uber.org/fx"
1415 "go.uber.org/fx/fxevent"
1516 "go.uber.org/zap"
17+ "go.uber.org/zap/zapcore"
1618)
1719
1820func startAgent (opts fx.Option ) {
@@ -36,6 +38,11 @@ var AgentModule = fx.Module("agent",
3638 cfg := zap .NewDevelopmentConfig ()
3739 if os .Getenv ("ENV" ) == "production" {
3840 cfg = zap .NewProductionConfig ()
41+ cfg .EncoderConfig .TimeKey = "time"
42+ cfg .EncoderConfig .EncodeTime = func (t time.Time , enc zapcore.PrimitiveArrayEncoder ) {
43+ enc .AppendString (t .UTC ().Format ("2006-01-02T15:04:05.000Z" ))
44+ }
45+ cfg .EncoderConfig .NameKey = "name"
3946 }
4047
4148 loggingLevel := zap .InfoLevel
@@ -48,7 +55,7 @@ var AgentModule = fx.Module("agent",
4855 if err != nil {
4956 panic (err )
5057 }
51- return logger
58+ return logger . Named ( "axon" )
5259 }),
5360 fx .Provide (cortexHttp .NewPrometheusRegistry ),
5461 fx .Provide (createHttpTransport ),
You can’t perform that action at this time.
0 commit comments