-
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
log4j2.disableJmx and/or log4j2.disable.jmx seem not to work #2774
Comments
@autumoswitzerland, thanks for your report, much appreciated. The described behaviour is indeed unexpected. I will create a custom Java runtime and try to reproduce the error – when JMX is disabled, the In the meantime,
|
The code seems to work as expected, the only problem I see is the severity of the status logger call, which should not be logging-log4j2/log4j-core/src/main/java/org/apache/logging/log4j/core/LoggerContext.java Lines 641 to 646 in f0cb225
logging-log4j2/log4j-core/src/main/java/org/apache/logging/log4j/core/jmx/Server.java Lines 133 to 141 in f0cb225
Unless I am mistaken the
To solve this issue I would propose to test the value of |
@autumoswitzerland, I have verified that As a temporary workaround, you need to add |
Thanks for the quick response and checking of the issue! It is not really critical, it was more a surprising behaviour on Linux. Still wondering why the switch is not in the log4j2 component properties, because that is imho the real issue; The system property is not copied into the component properties. Therefore, isJmxDisabled = false, at least on Linux! If it were true as expected, the dependency to java.management would be irrelevant. No? |
No, that is not the issue. The temporary workaround (until |
IMHO as a temporary workaround the status logger |
Yes, adding the module "java.management" prevents the output above. No log information is put out. |
Description
System property switches "log4j2.disableJmx" and/or "log4j2.disable.jmx" seem not to work!
Configuration
Version: 2.23.1 with slf4j 1.7.36
Operating system: Linux Mint 21.2 Cinnamon
JDK: Azu Zulu Build of OpenJDK - Zulu17.52+17-CA 17.0.12+7-LTS, Java version 17.0.12
Logs
Java-Code:
Later:
Reproduction
It's a linux jpackaged executable. Those JMX bean class-not-found-exceptions are only triggered on linux, the same code on Windows and mac doesn't even seem to miss any JMX code. The log4j2-JMX disable switches seem to have no effect. I wonder if they are even filled into the log4j component properties ?!
The text was updated successfully, but these errors were encountered: