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

Disable creation of Log4J JMX beans in Gradle test conventions #3751

Closed
sdavids opened this issue Apr 1, 2024 · 2 comments · Fixed by #3753
Closed

Disable creation of Log4J JMX beans in Gradle test conventions #3751

sdavids opened this issue Apr 1, 2024 · 2 comments · Fixed by #3753
Assignees
Milestone

Comments

@sdavids
Copy link
Contributor

sdavids commented Apr 1, 2024

Would it make sense to disable the creation of Log4J JMX beans?

Steps to reproduce

systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")

systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
systemProperty("log4j2.disableJmx", "true")

Context

To disable JMX completely, and prevent these MBeans from being created, specify system property log4j2.disableJmx to true when you start the Java VM.

https://logging.apache.org/log4j/2.x/manual/jmx.html#enabling-jmx

@sbrannen sbrannen changed the title Disable creation of Log4J JMX beans in test conventions? Disable creation of Log4J JMX beans in Gradle test conventions Apr 1, 2024
@sbrannen
Copy link
Member

sbrannen commented Apr 1, 2024

As long as we are not relying on their presence, it sounds reasonable to disable the JMX beans.

@marcphilipp and @sormuras, do you foresee any issue with disabling them?

@sormuras
Copy link
Member

sormuras commented Apr 3, 2024

No. Our tests don't rely on JMX to configure Log4J at runtime.

PR also looks good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants