-
Notifications
You must be signed in to change notification settings - Fork 417
Update LoggingEventJsonPatternParser to fix breaking logback change #1061
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
Update LoggingEventJsonPatternParser to fix breaking logback change #1061
Conversation
ea6b795 to
2c4e6b9
Compare
2c4e6b9 to
126adcf
Compare
|
Thanks @jordanjennings ! I really appreciate your investigation and fix. I agree that this would require a major version bump in logstash-logback-encoder. However, I am interested to see if there is a way to support both the old and new logback versions in 8.x. Even if it was "ugly", we could probably live with it until the next major logstash-logback-encoder version, at which point it could be removed. |
|
@philsttr Yes, there is a way using reflection, but it's a bit ugly. Here's how I originally approached the fix: I didn't go with this approach because it felt very brittle and likely to break again. However, it does keep compatibility until a major release of logstash-logback-encoder can be done. What do you think about this approach? |
|
Hey @jordanjennings , Yeah, I agree it's a bit brittle, but this repo has had to do similar things in the past to maintain compatibility with various breaking changes in logback. So, this works for me. And it's easy to remove in the next major version of logstash-logback-encoder, so at least it's not permanent. |
…1061) Maintain PatternLayout compatibility with logback <= 1.5.12 In logback 1.5.13, PatternLayoutBase.getInstanceConverterMap changed from `Map<String, String>` to `Map<String, Supplier<DynamicConverter>` To maintain compatibility with logback <= 1.5.12, use reflection to determine the type of the Map, and add entries appropriately. Fixes #1060 Co-authored-by: Jordan Jennings <[email protected]>
|
Hey @jordanjennings, I incorporated your approach and merged it in f4e5ff3 Thanks again for the contribution! |
|
@philsttr that’s fantastic news, thank you! What’s the expected timeline for cutting a release? |
|
Working on it now |
Fixes #1060
Although this fixes the compatibility issue with logback 1.5.13, it does have breaking version compatibility changes (due to the underlying breaking change made by logback itself). I've updated the README to indicate new minimum versions, but I didn't change anything with the pom.xml version number, even though this might be worthy of a major version bump since it breaks backwards compatibility with logback versions.