NTP-19782 | fix call state type:gst
This commit is contained in:
@@ -17,7 +17,7 @@ type Logger struct {
|
||||
var Log *Logger
|
||||
|
||||
func initiateLogger() *zap.Logger {
|
||||
config := zap.NewProductionConfig()
|
||||
config := NewCustomZapConfig()
|
||||
config.EncoderConfig = ecszap.ECSCompatibleEncoderConfig(config.EncoderConfig)
|
||||
log, err := config.Build(ecszap.WrapCoreOption(), zap.AddCallerSkip(1))
|
||||
log = log.With(zap.String("service", "cybertron"))
|
||||
|
||||
27
pkg/log/zapConfig.go
Normal file
27
pkg/log/zapConfig.go
Normal file
@@ -0,0 +1,27 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
func NewCustomZapConfig() zap.Config {
|
||||
rawJSON := []byte(`{
|
||||
"level": "debug",
|
||||
"development": false,
|
||||
"sampling": {
|
||||
"initial": 100,
|
||||
"thereafter": 100
|
||||
},
|
||||
"disableCaller": true,
|
||||
"encoding": "json",
|
||||
"OutputPaths": ["stdout"],
|
||||
"ErrorOutputPaths": ["stderr"]
|
||||
}`)
|
||||
|
||||
var cfg zap.Config
|
||||
if err := json.Unmarshal(rawJSON, &cfg); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return cfg
|
||||
}
|
||||
Reference in New Issue
Block a user