Open ppkarwasz opened 1 week ago
You might be probably interested in the discussion on apache/logging-log4j2#3038 and related PRs. The log4j-slf4j-impl
artifact has a useless runtime log4j-core
dependency. The "advantage" of this solution is that users don't need to explicitly add log4j-core
to their dependencies, but this breaks the usage of other Log4j API implementations like log4j2-android
.
Currently
log4j2-android
uses thelog4j2.loggerContextFactory
to register itself with the Log4j API. The usage of this property is deprecated since version2.24.0
and will be removed in the future.Please implement a
Provider
class and register it withServiceLoader
in aMETA-INF/services/org.apache.logging.log4j.spi.Provider
class.The
Provider
service determines both theLoggerContextFactory
to use with theLogManager
class and theThreadContextMap
to use with theThreadContext
class. Since the Android Log API does not handle context data, I would suggest to set the latter toNoOpThreadContextMap
: