Skip to content
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

Replace the Log4j implementation with Logback #5673

Merged
merged 7 commits into from
Aug 23, 2022

Conversation

sschuberth
Copy link
Member

Please have a look at the individual commit messages for the details.

The configured precision of 36 never really had any effect as the number
refers to the number of name components, not characters, and no logger
name exceeded 36 components.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
These versions could theoretically be different, and independent
versioninig eases the migration to a different logging implementation only
while keeping the API.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
This change is not so much about the past security flaws in the Log4j
implementation [1], but more about generally switching (back) to a more
lightweight logger that also plays more nicely with GraalVM [2].

However, stick to Log4j on the API side as it is more powerful than SLF4J,
see [3].

This commit restores the Logback configuration files from bac29f6 and
updates them with changes meanwhile done to `log4j2.xml`.

[1]: https://blog.ltgt.net/migrating-off-log4j2/
[2]: micronaut-projects/micronaut-core#6041 (comment)
[3]: https://kajalrawal.medium.com/log4j2-is-it-worth-to-use-slf4j-with-log4j2-21e83d0d792c

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
See [1]. Once [2] is resolved the official Gradle plugin should be used
instead of the current Palantir plugin [3] to benefit from automatic
download of reachability-metadata [4].

Note that still more work is required to make the native-image build
succeed.

[1]: https://github.com/oracle/graalvm-reachability-metadata/blob/master/metadata/ch.qos.logback/logback-classic/1.2.11/reflect-config.json
[2]: graalvm/native-build-tools#100
[3]: https://github.com/palantir/gradle-graal
[4]: https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html#metadata-support

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
@sschuberth sschuberth requested a review from a team as a code owner August 22, 2022 20:09
@codecov
Copy link

codecov bot commented Aug 22, 2022

Codecov Report

Merging #5673 (d3b38d4) into main (ebf16d8) will decrease coverage by 0.01%.
The diff coverage is n/a.

@@             Coverage Diff              @@
##               main    #5673      +/-   ##
============================================
- Coverage     65.51%   65.50%   -0.02%     
  Complexity     2212     2212              
============================================
  Files           271      271              
  Lines         16580    16580              
  Branches       3432     3432              
============================================
- Hits          10862    10860       -2     
- Misses         4575     4577       +2     
  Partials       1143     1143              
Flag Coverage Δ
funTest-analyzer-docker 74.47% <ø> (ø)
funTest-non-analyzer 46.13% <ø> (ø)
test 32.05% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
.../curation/ClearlyDefinedPackageCurationProvider.kt 46.42% <0.00%> (-2.39%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@sschuberth sschuberth merged commit 1403877 into main Aug 23, 2022
@sschuberth sschuberth deleted the log4j-api-vs-logback-impl branch August 23, 2022 06:17
@mnonnenmacher mnonnenmacher added the release notes Changes that should be mentioned in release notes label Aug 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release notes Changes that should be mentioned in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants