Closed thehejik closed 2 months ago
I think we can configure our loggers.
Both controllers should have these args, where --debug
controls --zap-devel
:
--debug Turn on debug logging
--debug-level int If debugging is enabled, set klog -v
--zap-devel Development Mode defaults(encoder=consoleEncoder,logLevel=Debug,stackTraceLevel=Warn). Production Mode defaults(encoder=jsonEncoder,logLevel=Info,stackTraceLevel=Error) (default true)
--zap-encoder encoder Zap log encoding (one of 'json' or 'console')
--zap-log-level level Zap Level to configure the verbosity of logging. Can be one of 'debug', 'info', 'error', or any integer value > 0 which corresponds to custom debug levels of increasing verbosity
--zap-stacktrace-level level Zap Level at and above which stacktraces are captured (one of 'info', 'error', 'panic').
--zap-time-encoding time-encoding Zap time encoding (one of 'epoch', 'millis', 'nano', 'iso8601', 'rfc3339' or 'rfc3339nano'). Defaults to 'epoch'.
However
--debug-level
doesn't set --zap-log-level
(https://github.com/rancher/fleet/blob/main/internal/cmd/controller/gitops/operator.go#L79, https://github.com/rancher/fleet/blob/main/internal/cmd/controller/root.go#L92).
Is there an existing issue for this?
Current Behavior
After sending a webhook event with wrong credentials, for eg. from Azure DevOps on push, there is following error in gitjob logs with stacktrace:
Reproducer
rancher:v2.9-c42447977787af1230f82e3dcf92c4895d5723df-head
with fleet104.0.0+up0.10.0-rc.14
kubectl logs -n cattle-fleet-system -lapp=gitjob
Expected Behavior
The error itself makes sense, but the stacktrace is a bit too much.