-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
StructuredLogFormatter exceptions are not visible to the user #43384
Comments
Logback documentation: https://logback.qos.ch/manual/configuration.html#dumpingStatusData
|
Log4j2 is not affected, it will fallback to
|
For Logback, unwanted INFO level status can not be filtered out if we register
I still think |
We could implement a
I don't. We should not circumvent the status logging facilities in Logback. |
Before this commit, any exceptions thrown in Logback encoders were just swallowed. This commit adds the FilteringStatusListener that delegates to OnErrorConsoleStatusListener to print any errors that happened in logback encoders. See spring-projectsgh-43384
Before this commit, any exceptions thrown in Logback encoders were just swallowed. This commit adds the FilteringStatusListener that delegates to OnErrorConsoleStatusListener to print any errors that happened in logback encoders. See spring-projectsgh-43384
Currently, if
StructuredLogFormatter
throws an exception it is silently swallowed and the user doesn't know something has gone wrong. PR #43371 provides one possible fix where we print the exception directly, however, we might be better trying to hook into the support of the underlying logging framework.Logback has the concept of a
Status
event which it uses to pass exceptions raised from aLogEncoder
. It also has aOnErrorConsoleStatusListener
which will print errors toSystem.err
.Log4J2 has a
DefaultErrorHandler
which either ignores exceptions or throws aAppenderLoggingException
.The text was updated successfully, but these errors were encountered: