2.14.1 (2021-03-06)
This release contains a number of bug fixes and minor enhancements which are listed below.
Due to a break in compatibility in the SLF4J binding, Log4j now ships with two versions of the SLF4J to Log4j adapters.
log4j-slf4j-impl
should be used with SLF4J 1.7.x and earlier and log4j-slf4j18-impl
should be used with SLF4J 1.8.x and later.
The Log4j 2.14.1 API, as well as many core components, maintains binary compatibility with previous releases.
Log4j 2.14.1 requires a minimum of Java 8 to build and run. Log4j 2.12.1 is the last release to support Java 7.
For complete information on Apache Log4j 2, including instructions on how to submit bug reports, patches, or suggestions for improvement, see the Apache Log4j 2 website.
Changes
Added
-
Enrich "map" resolver by unifying its backend with "mdc" resolver. (for LOG4J2-2962 by Volkan Yazıcı)
-
Support stack trace truncation in JsonTemplateLayout. (for LOG4J2-2993 by Volkan Yazıcı)
-
Replace JsonTemplateLayout resolver configurations table in docs with sections. (for LOG4J2-2999 by Volkan Yazıcı)
Changed
-
Allow reconfiguration when Log4j 1 configuration files are updated. (for LOG4J2-2893 by Ralph Goers)
-
Add Rollover Listener to aid in unit test validation. (for LOG4J2-2923 by Ralph Goers)
-
Replace outdated PatternLayout.createLayout() calls in docs with createDefaultLayout(). (for LOG4J2-2977 by Volkan Yazıcı, Ron Grabowski)
-
Update JSON Unit 2.21.0 → 2.22.0. (for by Gary Gregory)
-
Update JaCoCo 0.8.3 → 0.8.6. (for by Gary Gregory)
-
Update Mockito 3.6.0 → 3.7.0. (for by Gary Gregory)
-
Update MongoDB 3 plugin: org.mongodb:mongodb-driver 3.12.6 → 3.12.7. (for by Gary Gregory)
-
Update MongoDB 4 plugin: org.mongodb:* 4.1.0 → 4.1.1. (for by Gary Gregory)
-
Update Spring dependencies to 5.3.2, Spring Boot to 2.3.6, and Spring Cloud to Hoxton.SR9 (for by Ralph Goers)
-
Update Woodstox 5.0.3 → 6.2.3 to match Jackson 2.12.1. (for by Gary Gregory)
-
Update XML Unit 2.8.0 → 2.8.2. (for by Gary Gregory)
-
Update com.fasterxml.jackson.: 2.11.2 - 2.11.3. (for by Gary Gregory)
-
Update commons-codec:commons-codec 1.14 → 1.15. (for by Gary Gregory)
-
Update commons-io:commons-io 2.7 → 2.8.0. (for by Gary Gregory)
-
Update de.flapdoodle.embed:de.flapdoodle.embed.mongo 2.2.0 → 3.0.0. (for by Gary Gregory)
-
Update junit:junit 4.13 → 4.13.1. (for by Gary Gregory)
-
Update mongodb4.version 4.1.1 → 4.2.0. (for by Gary Gregory)
-
Update net.javacrumbs.json-unit:json-unit 1.31.1 → 2.22.0. (for by Gary Gregory)
-
Update net.javacrumbs.json-unit:json-unit 2.22.0 → 2.23.0. (for by Gary Gregory)
-
Update org.apache.activemq:* 5.16.0 → 5.16.1. (for by Gary Gregory)
-
Update org.apache.commons:commons-dbcp2 2.4.0 → 2.8.0. (for by Gary Gregory)
-
Update org.apache.commons:commons-lang3 3.10 → 3.11. (for by Gary Gregory)
-
Update org.apache.commons:commons-pool2 2.8.1 → 2.9.0. (for by Gary Gregory)
-
Update org.assertj:assertj-core 3.14.0 → 3.18.1. (for by Gary Gregory)
-
Update org.assertj:assertj-core 3.18.1 → 3.19.0. (for by Gary Gregory)
-
Update org.awaitility:awaitility 4.0.2 → 4.0.3. (for by Gary Gregory)
-
Update org.codehaus.groovy:* 3.0.5 → 3.0.6. (for by Gary Gregory)
-
Update org.codehaus.plexus:plexus-utils 3.2.0 → 3.3.0. (for by Gary Gregory)
-
Update org.eclipse.tycho:org.eclipse.osgi 3.12.1.v20170821-1548 → 3.13.0.v20180226-1711. (for by Gary Gregory)
-
Update org.fusesource.jansi:jansi 1.17.1 → 2.0.1. (for by Gary Gregory)
-
Update org.fusesource.jansi:jansi 1.18 → 2.2.0. (for by Gary Gregory)
-
Update org.fusesource.jansi:jansi 1.18 → 2.3.1. (for by Gary Gregory)
-
Update org.mockito:mockito-* 3.7.0 → 3.7.7. (for by Gary Gregory)
-
Update org.springframework:* 5.2.8.RELEASE → 5.3.1. (for by Gary Gregory)
-
Update org.springframework:* 5.3.2 → 5.3.3. (for by Gary Gregory)
-
Update org.xmlunit:* 2.7.0 → 2.8.0. (for by Gary Gregory)
-
- com.fasterxml.jackson.core:jackson-annotations …………….. 2.12.1 → 2.12.2 - com.fasterxml.jackson.core:jackson-core …………………… 2.12.1 → 2.12.2 - com.fasterxml.jackson.core:jackson-databind ……………….. 2.12.1 → 2.12.2 - com.fasterxml.jackson.dataformat:jackson-dataformat-xml …….. 2.12.1 → 2.12.2 - com.fasterxml.jackson.dataformat:jackson-dataformat-yaml ……. 2.12.1 → 2.12.2 - com.fasterxml.jackson.module:jackson-module-jaxb-annotations … 2.12.1 → 2.12.2 - org.apache.commons:commons-lang3 …………………………. 3.11 → 3.12.0 - org.junit.jupiter:junit-jupiter-engine ……………………. 5.7.0 → 5.7.1 - org.junit.jupiter:junit-jupiter-migrationsupport …………… 5.7.0 → 5.7.1 - org.junit.jupiter:junit-jupiter-params ……………………. 5.7.0 → 5.7.1 - org.junit.vintage:junit-vintage-engine ……………………. 5.7.0 → 5.7.1 - org.mockito:mockito-core ………………………………… 3.7.7 → 3.8.0 - org.mockito:mockito-junit-jupiter ………………………… 3.7.7 → 3.8.0 - org.mongodb:bson ……………………………………….. 4.2.0 → 4.2.2 - org.mongodb:mongodb-driver-sync ………………………….. 4.2.0 → 4.2.2 (for by Gary Gregory)
Fixed
-
Allow auto-shutdown of log4j in log4j-web to be turned off and provide a ServletContextListener "Log4jShutdownOnContextDestroyedListener" to stop log4j. Register the listener at the top of web.xml to ensure the shutdown happens last. (for LOG4J2-1606 by Matt Sicker, Tim Perry)
-
Allow auto-shutdown of log4j in log4j-web to be turned off and provide a ServletContextListener "Log4jShutdownOnContextDestroyedListener" to stop log4j. Register the listener at the top of web.xml to ensure the shutdown happens last. (for LOG4J2-2624 by Matt Sicker, Tim Perry)
-
Avoid redundant Kafka producer instantiation causing thread leaks. (for LOG4J2-2916 by Volkan Yazıcı, wuqian0808)
-
Document that LogBuilder default methods do nothing. (for LOG4J2-2947 by Ralph Goers)
-
Replace HashSet with IdentityHashMap in ParameterFormatter to detect cycles. (for LOG4J2-2948 by Volkan Yazıcı)
-
Fix reading of JsonTemplateLayout event additional fields from config. (for LOG4J2-2961 by Volkan Yazıcı)
-
Merge packages from several Configurations in Composite Configuration. (for LOG4J2-2964 by Volkan Yazıcı, Valery Yatsynovich)
-
Fix JsonTemplateLayout index based parameter resolution when messages contain too few parameters. (for LOG4J2-2967 by Carter Kozak)
-
Refactor AsyncAppender and AppenderControl for handling of Throwables. (for LOG4J2-2972 by Volkan Yazıcı)
-
Rename EventTemplateAdditionalField#type (conflicting with properties file parser) to "format". (for LOG4J2-2973 by Volkan Yazıcı, Fabio Ricchiuti)
-
Log4j would fail to initialize in Java 8 with log4j-spring-boot. (for LOG4J2-2974 by Ralph Goers)
-
JdbcAppender composes an incorrect INSERT statement without a ColumnMapping element. (for LOG4J2-2976 by Carter Kozak)
-
OnStartupTriggeringPolicy would fail to cause the file to roll over with DirectWriteTriggeringPolicy unless minSize was set to 0. (for LOG4J2-2981 by Ralph Goers)
-
Add eventTemplateRootObjectKey parameter to JsonTemplateLayout. (for LOG4J2-2985 by Volkan Yazıcı)
-
Reduce garbage by using putAll when copying the ThreadContext for SLF4J. (for LOG4J2-2990 by Ralph Goers, Diogo Monteiro)
-
Fix truncation of excessive strings ending with a high surrogate in JsonWriter. (for LOG4J2-2998 by Volkan Yazıcı)
-
Directly create a thread instead of using the common ForkJoin pool when initializing ThreadContextDataInjector" (for LOG4J2-3006 by Ralph Goers)
-
Log4j1ConfigurationConverter on Windows produces " " at end of every line. (for LOG4J2-3014 by Gary Gregory, Lee Breisacher)
-
OutputStreamManager.flushBuffer always resets the buffer, previously the buffer was not reset after an exception. (for LOG4J2-3028 by Carter Kozak, Jakub Kozlowski)
-
Add log method with no parameters - i.e. it has an empty message. (for LOG4J2-3033 by Ralph Goers)
-
Attempting to call getExtendedStackTraceAsString() after deserializing JSON LogEvent results in a NPE. (for LOG4J2-3131 by Gary Gregory, Adam Long)
-
NoGcLayout allocates empty bytes arrays for its header and footer. (for LOG4J2-3131 by Gary Gregory, Gary Gregory)