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 programmatic configuration if log4j1.compatibility is false (LOG4J2-3467) #2778

Closed
ppkarwasz opened this issue Jul 30, 2024 · 1 comment · Fixed by #2783
Closed
Labels
bug Incorrect, unexpected, or unintended behavior of existing code legacy-1.2-bridge
Milestone

Comments

@ppkarwasz
Copy link
Contributor

ppkarwasz commented Jul 30, 2024

This issue is moved from the LOG4J2-3467 JIRA issue.

The log4j-1.2-api artifact is a bridge, whose main purpose is to forward Log4j 1 "API" calls to Log4j 2 API.

Version 2.17.2 of the artifact introduced support for configuring Log4j Core using the Log4j 1 PropertyConfigurator and DOMConfigurator classes.
This feature should be disabled by default and depend on the opt-in log4j1.compatibility property, because:

  • many third-party libraries (not related to logging) take upon themselves the reconfiguration of Log4j 1. This steals the control of logging configuration from application developers (see How to disable log4j programmatic reconfiguration from a 3rd party jar for example).
  • if some applications actually use those classes, they can always set log4j1.compatibility to true. This configuration property is also used to enable the scanning of the classpath for log4j.properties and log4j.xml files.
@ppkarwasz ppkarwasz added bug Incorrect, unexpected, or unintended behavior of existing code legacy-1.2-bridge labels Jul 31, 2024
@vy vy added this to the 2.24.0 milestone Aug 8, 2024
@garydgregory
Copy link
Member

Sounds reasonable. This should be front-and-center in the release notes in a MINOR release, not a MAINTENANCE release as it is an important behavior breaking change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Incorrect, unexpected, or unintended behavior of existing code legacy-1.2-bridge
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants