Skip to content

The core.Logger#setLevel method should work like Configurator#setLevel #2281

Closed
@ppkarwasz

Description

@ppkarwasz

The main difference between the core.Logger#setLevel method and Configurator#setLevel is that the former changes only the level of a specific logger, while the latter also changes the level of child loggers.

As documented in its Javadoc, the core.Logger#setLevel method is not part of the public API (so it can do whatever it wants). However it is used in log4j-1.2-api and log4j-jul instead of the more correct Configurator#setLevel method and it causes those modules to misbehave.

We can therefore:

  • either change the way Logger#setLevel works to match the behavior of Configurator#setLevel (IMHO it is the best option, since it prevents mistakes from committers and users),
  • or simply replace Logger#setLevel with Configurator#setLevel in log4j-1.2-api and log4j-jul.

Metadata

Metadata

Assignees

Labels

apiAffects the public APIbugIncorrect, unexpected, or unintended behavior of existing code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions