-
Notifications
You must be signed in to change notification settings - Fork 233
Disable stack traces #1590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Disable stack traces #1590
Conversation
These extra logs provide very little value, but take up a lot of physical and visual space
packages/shared/pkg/logger/logger.go
Outdated
| // Console logging configuration | ||
| config := zap.Config{ | ||
| DisableStacktrace: loggerConfig.DisableStacktrace, | ||
| DisableStacktrace: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hardcoding DisableStacktrace: true ignores the LoggerConfig.DisableStacktrace field passed by callers. This breaks the API contract where callers might intentionally pass DisableStacktrace: false to enable stacktraces for debugging. Consider: DisableStacktrace: loggerConfig.DisableStacktrace or remove the field from the config struct if it's no longer needed.
| IsInternal: config.IsInternal, | ||
| IsDebug: true, | ||
| DisableStacktrace: !config.IsInternal, | ||
| DisableStacktrace: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same issue: hardcoding DisableStacktrace: true ignores the conditional logic \!config.IsInternal that was previously used. This means internal services lose the ability to enable stacktraces even when needed for debugging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there's a reason to log stack traces for every log message
jakubno
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be also worth checking Development field in zap.Config in
packages/shared/pkg/logger/logger.go
These extra logs provide very little value, but take up a lot of physical and visual space