Skip to content

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

@ppkarwasz

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect, unexpected, or unintended behavior of existing codelegacy-1.2-bridge

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions