This release provides a continuation of the modularization process of Log4j Core.
The following features were moved to separate artifacts:
- The async logger feature was moved to
log4j-async-loggerand it was upgraded to use LMAX Disruptor 4.x. The async appender is still available by default inlog4j-core. - The YAML configuration is available now in
log4j-config-yaml. - The Java properties configuration was removed and replaced with a similar format based on
jackson-dataformat-propertiesin a newlog4j-config-propertiesartifact.
Other features were removed:
- Jetty 9.x users are encouraged to migrate to Jetty 10.x or later and replace
log4j-appserverwithlog4j-slf4j2-impl. - Tomcat JULI support will be available from a third-party (cf. copernik-eu/log4j-plugins).
- Apache Commons Logging users are encouraged to upgrade
commons-loggingto version 1.3.0 or later and removelog4j-jcl. - Support for the XML layout was dropped.
- Support for JMX was dropped and will be replaced with a more recenttechnology.
Added
- Add and update DSLs for setting up dependency injection for test and non-test code. (#2147)
- Add a
ConfigurationExtensionmechanism to allow third-party JARs to extend the<Configuration>element. - Add a new properties configuration factory based on
jackson-dataformat-properties.
Changed
- Change the order of evaluation of
FormattedMessageformatters. Messages are evaluated usingjava.util.Formatonly if they don't comply to thejava.text.MessageFormatorParameterizedMessageformat. (#1223) - Split off async logger support into a new
log4j-async-loggermodule. - Split off YAML configuration into a new
log4j-config-yamlmodule.
Fixed
- Rewrote message parameter formatter with improved escape handling (#1626)
- The MongoDb4 appender now supports long values to configure
collectionSize(#1747) - Mark
JdkMapAdapterStringMapas frozen if map is immutable. (#2098) - Fix regression in
JdkMapAdapterStringMapperformance. (#2238) - Prevents ClassCastException when trying to assign a SimpleLoggerContext to a core LoggerContext (LOG4J2-1921)
- Possible NullPointerException in MongoDb4DocumentObject, MongoDbDocumentObject, DefaultNoSqlObject. (LOG4J2-3392)
- Fix NPE in
CloseableThreadContext. (#1426) - Fix NPE in
RollingFileManager. (#1645) - Fix
log4j-spring-cloud-config-clientdependencies to include only those required. (2157) - Workaround a Coursier/Ivy dependency resolution bug affecting
log4j-slf4j-implandlog4j-mongodb3. (#2065)
Removed
- Removed legacy
2.xproperties configuration factory. - Removed
DefaultLogEventFactory - Removed
log4j-appservermodule (#2257) - Removed
org.apache.logging.log4j.core.parserand related packages. (#2154) - Removed
log4j-jclmodule (#2257) - Removed JMX support.
- Remove
log4j-layout-jacksonmodule (#2198) - Remove
log4j-layout-jackson-xmlmodule (#2198) - Remove
log4j2.enable.threadlocalsproperty (#2105)
Updated
- Update
com.fasterxml.jackson:jackson-bomto version2.16.1(#2127) - Update
commons-codec:commons-codecto version1.16.1(#2276) - Update
io.netty:netty-bomto version4.1.107.Final(#2283) - Update
org.apache.logging:logging-parentto version10.6.0(#2193) - Update
org.apache.tomcat:tomcat-julito version10.1.18(#2176) - Update
org.eclipse.jetty:jetty-bomto version9.4.54.v20240208(#2285) - Update
org.jctools:jctools-coreto version4.0.3(#2267) - Update
org.slf4j:slf4j-apito version2.0.10(#2136) - Update
org.springframework.boot:spring-boot-autoconfigureto version3.2.2(#2222) - Update
org.springframework.cloud:spring-cloud-contextto version4.1.1(#2236) - Update
org.springframework:spring-framework-bomto version6.1.4(#2294)