Skip to content

Commit 9232c4e

Browse files
fwieselnotandy
authored andcommitted
Default to stack-traces in logging only when panic
In development, each error will yield a stacktrace, but we have too many of them.
1 parent e2e258d commit 9232c4e

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

cmd/main.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,10 @@ func main() {
9494
"Name of the certificate issuer.")
9595

9696
opts := ctrlzap.Options{
97-
Development: true,
98-
TimeEncoder: zapcore.ISO8601TimeEncoder,
99-
ZapOpts: []zap.Option{zap.WrapCore(logger.WrapCore)},
97+
Development: true,
98+
TimeEncoder: zapcore.ISO8601TimeEncoder,
99+
ZapOpts: []zap.Option{zap.WrapCore(logger.WrapCore)},
100+
StacktraceLevel: zap.DPanicLevel,
100101
}
101102
opts.BindFlags(flag.CommandLine)
102103
flag.Parse()

0 commit comments

Comments
 (0)