Print RuntimeException raised by StructuredLogFormatter::format to system err#43371
Print RuntimeException raised by StructuredLogFormatter::format to system err#43371quaff wants to merge 1 commit intospring-projects:mainfrom
Conversation
|
This is an interesting problem. I'm not sure if |
StructuredLogFormatter::format to system err…system err Before this commit, runtime exception is swallowed silently. For example, if two `StructuredLoggingJsonMembersCustomizer` add same key, exception is printed now: ``` Exception in thread "main" java.lang.IllegalStateException: The name 'test' has already been written at org.springframework.util.Assert.state(Assert.java:101) at org.springframework.boot.json.JsonValueWriter.writePair(JsonValueWriter.java:228) at org.springframework.boot.json.JsonValueWriter.write(JsonValueWriter.java:83) at org.springframework.boot.json.JsonWriter$Member.write(JsonWriter.java:650) at org.springframework.boot.json.JsonWriter$Members.write(JsonWriter.java:339) ```
Amended as your suggestion. |
|
I assumed that Logback would handle any exception raised in an encoder. If that's not the case, |
Before this commit, runtime exception is swallowed silently.
For example, if two
StructuredLoggingJsonMembersCustomizeradd same key, exception is printed now: