Skip to content

Commit

Permalink
add stack traces to error logs (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwe authored Feb 23, 2024
1 parent 7efe51f commit 50cd638
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,12 @@ func (l *ZapLogger) ToZap() *zap.SugaredLogger {
c = zaputil.NewSamplerCore(c, l.sampler)
}

zl := zap.New(c, zap.AddCaller(), zap.AddCallerSkip(l.callerSkip))
zl := zap.New(
c,
zap.AddCaller(),
zap.AddCallerSkip(l.callerSkip),
zap.AddStacktrace(zap.ErrorLevel),
)

if l.name == "" || l.component == "" {
zl = zl.Named(l.name + l.component)
Expand Down

0 comments on commit 50cd638

Please sign in to comment.