-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Several ClassNotFoundException warnings after upgrading to 2.23.x #2835
Comments
The warning statements you are seeing were always present in the Log4j codebase, but were only visible if the Since many Log4j plugins require additional dependencies, we should probably add a special clause to handle a Lines 476 to 478 in e2d1a95
|
Thank you for the clarification, I was not aware of this, probably did not use verbose mode before. It seems this does not affect functionality, but adds several thousand lines of traces to every application boot at WARN level which makes following the application startup much harder. And this is also present in test output where loggers are loaded. If these are useful messages for some for troubleshooting, maybe we could make it DEBUG or lower so they are hidden at least on I did not notice the name of the plugins causing the exceptions either. I was wondering if there was a way to disable the offending ones or just be more explicit about which ones to load? |
@mihalyr, thanks so much for the report. I will try to make sure this is resolved in the next major release, i.e.,
That can indeed be a resolution. Regardless of that, I'd advise you to
This is a complicated issue. In short, there are several
@ppkarwasz, I doubt if a whitelist of exceptions will cut it. Why don't we rather change the logged status message severity to |
This improves status logger warnings about: * missing `Log4j2Plugin.dat` plugin descriptors, * usage of package scanning. The warnings are reworded in a way that they are more useful to end-users. If package scanning is enabled, linkage errors (almost exclusively due to optional dependencies) are logged at a `DEBUG` level instead of `WARN`. This addresses @vlsi suggestions from apache/jmeter#5937 (comment) and fixes #2835.
That is what I meant. Linkage errors ( Lines 472 to 476 in b941a99
|
Description
Updating log4j from 2.22.1 to 2.23.0 or 2.23.1 causes a long list of warnings with exception traces for ClassNotFound exceptions for various class files.
Configuration
Version: 2.23.1 (latest)
Operating system: Linux 6.9.12-200.fc40.x86_64 (Fedora 40)
JDK: OpenJDK Runtime Environment Corretto-21.0.4.7.1 (build 21.0.4+7-LTS)
Logs
I could not paste in the full log due to GitHub issue description restrictions, but this same exception trace continues for 36 other classes:
Reproduction
I have a very small reproducer for this
build.gradle
src/test/resources/log4j2-test.properties
src/test/java/LoggingTest.java
Execute with
./gradlew test -i --rerun
or in you IDE.I have noticed the following:
packages
from thelog4j2-test.properties
file the problem also goes awayHowever, there is a reason, why I still use
packages
for some plugins, various annotation processors configured used to cause issues and I was never able to make log4j plugin discovery work without thepackages
configuration. But that is a separate issue,packages
is still supported in2.23.x
, so this should still work the same way it did on2.22.x
, IMO. As a workaround, I can just downgrade to 2.22.1 for now.The text was updated successfully, but these errors were encountered: