Closed as not planned
Description
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 a LogEncoder
. It also has a OnErrorConsoleStatusListener
which will print errors to System.err
.
Log4J2 has a DefaultErrorHandler
which either ignores exceptions or throws a AppenderLoggingException
.