How can I include timestamps/loglevel/callers in the structure while in Development mode? #1175
Unanswered
mirumirumi
asked this question in
Q&A
Replies: 1 comment
-
Hello, @mirumirumi. Thanks for your question. cfg := zap.NewDevelopmentConfig()
cfg.EncoderConfig = zap.NewProductionEncoderConfig()
logger, err := cfg.Build() |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I prefer all conditions generated by
NewDevelopment()
.However, I just don't like the fact that
timestamp
,loglevel
andcaller
are outside the structured log.Using
NewProduction()
solves this problem, but then other problems occur, such as no debug level logs.How can I include it in the structured log as NewDevelopment?
Beta Was this translation helpful? Give feedback.
All reactions