From 1144b0866e2482f4ec3e66aa39753b0fabc56d21 Mon Sep 17 00:00:00 2001 From: Fabian Wiesel Date: Thu, 23 Oct 2025 16:29:06 +0200 Subject: [PATCH] Default to stack-traces in logging only when panic In development, each error will yield a stacktrace, but we have too many of them. --- cmd/main.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cmd/main.go b/cmd/main.go index e6885793..3f5e59a2 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -94,9 +94,10 @@ func main() { "Name of the certificate issuer.") opts := ctrlzap.Options{ - Development: true, - TimeEncoder: zapcore.ISO8601TimeEncoder, - ZapOpts: []zap.Option{zap.WrapCore(logger.WrapCore)}, + Development: true, + TimeEncoder: zapcore.ISO8601TimeEncoder, + ZapOpts: []zap.Option{zap.WrapCore(logger.WrapCore)}, + StacktraceLevel: zap.DPanicLevel, } opts.BindFlags(flag.CommandLine) flag.Parse()