Description
When upgrading log4j-api to 2.24.1 while still using log4j-core 2.24.0, LogManager.getLogger() returns null.
This seems to be caused by changes to LoggerRegistry in log4j-api.
This version-mismatch happens easily if a library like Apache POI upgrades "api" to the latest version, but projects using it do not upgrade log4j-core along the way. This is likely a common situation as libraries should only depend on "api" and thus cannot enforce a newer version of "core".
It's unexpected to run into such an incompatibility, especially in a minor bugfix-release of log4j.
Configuration
Version: api 2.24.1, core 2.24.0
Operating system: Linux
JDK: JDK 11 + 17
Logs
Code is simply
public static final Logger LOG = LogManager.getLogger(Class.class);
This later triggers a NullPointerExceptions as LOG is null.
Reproduction
Run ./gradlew runWriteFile -PpoiVersion=5.4.0 in a checkout of https://github.com/centic9/poi-reproduce
Description
When upgrading log4j-api to 2.24.1 while still using log4j-core 2.24.0,
LogManager.getLogger()returnsnull.This seems to be caused by changes to
LoggerRegistryin log4j-api.This version-mismatch happens easily if a library like Apache POI upgrades "api" to the latest version, but projects using it do not upgrade log4j-core along the way. This is likely a common situation as libraries should only depend on "api" and thus cannot enforce a newer version of "core".
It's unexpected to run into such an incompatibility, especially in a minor bugfix-release of log4j.
Configuration
Version: api 2.24.1, core 2.24.0
Operating system: Linux
JDK: JDK 11 + 17
Logs
Code is simply
This later triggers a NullPointerExceptions as LOG is null.
Reproduction
Run
./gradlew runWriteFile -PpoiVersion=5.4.0in a checkout of https://github.com/centic9/poi-reproduce