Skip to content

Disable programmatic configuration if log4j1.compatibility is false (LOG4J2-3467) #2778

Closed

Description

@ppkarwasz

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.

Activity

  1. added 2 commits that reference this issue on Jul 31, 2024
    bf74a76
    dc92332
  2. added
    bug
    on Jul 31, 2024
  3. added this to the 2.24.0 milestone on Aug 8, 2024
  4. garydgregory commented on Aug 8, 2024

    @garydgregory
    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.

  5. added a commit that references this issue on Aug 16, 2024
    e6c7f19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buglegacy-1.2-bridge

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions