| --- |
| layout: post |
| status: PUBLISHED |
| published: true |
| title: Log4j 2.14.0 Released |
| id: 31f10c37-b9c3-4289-8feb-56c47dc3b711 |
| date: '2020-11-11 05:48:42 -0500' |
| categories: logging |
| tags: [] |
| permalink: logging/entry/log4j-2-14-0-released |
| --- |
| <p>The Apache Log4j 2 team is pleased to announce the Log4j 2.14.0 release!</p> |
| <p>Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade<br /> |
| to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides<br /> |
| many other modern features such as support for Markers, lambda expressions for lazy logging,<br /> |
| property substitution using Lookups, multiple patterns on a PatternLayout and asynchronous<br /> |
| Loggers. Another notable Log4j 2 feature is the ability to be "garbage-free" (avoid allocating<br /> |
| temporary objects) while logging. In addition, Log4j 2 will not lose events while reconfiguring.</p> |
| <p>The artifacts may be downloaded from <a href="https://logging.apache.org/log4j/2.x/download.html" rel="nofollow">https://logging.apache.org/log4j/2.x/download.html</a>.</p> |
| <p>This release contains a new Layout, JsonTemplateLayout, that is intended to ultimately replace JsonLayout. As its<br /> |
| name suggests it uses a template to define the elements to include in the JSON. This Layout was contributed by the<br /> |
| author of the log4j2-logstash-layout at GitHub, and who is now a member of the Log4j community.</p> |
| <p>Log4j 2.14.0 adds support for MongoDB 4 and removes support for MongoDB 2.</p> |
| <p>This release also contains a number of bug fixes which are listed below.</p> |
| <p>Due to a break in compatibility in the SLF4J binding, Log4j now ships with two versions of the SLF4J to Log4j adapters.<br /> |
| 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<br /> |
| later.</p> |
| <p>The Log4j 2.14.0 API, as well as many core components, maintains binary compatibility with previous releases.</p> |
| <h2><a id="user-content-ga-release-2140" class="anchor" aria-hidden="true" href="#ga-release-2140"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"> |
| <path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>GA Release 2.14.0</h2> |
| <p>Changes in this version include:</p> |
| <h3><a id="user-content-new-features" class="anchor" aria-hidden="true" href="#new-features"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"> |
| <path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>New Features</h3> |
| <ul> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2957" rel="nofollow">LOG4J2-2957</a>:<br /> |
| Add JsonTemplateLayout.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2848" rel="nofollow">LOG4J2-2848</a>:<br /> |
| Create module log4j-mongodb4 to use new major version 4 MongoDB driver.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2858" rel="nofollow">LOG4J2-2858</a>:<br /> |
| More flexible configuration of the Disruptor WaitStrategy. Thanks to Stepan Gorban.</li> |
| </ul> |
| <h3><a id="user-content-fixed-bugs" class="anchor" aria-hidden="true" href="#fixed-bugs"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"> |
| <path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Fixed Bugs</h3> |
| <ul> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2925" rel="nofollow">LOG4J2-2925</a>:<br /> |
| Fix broken link in FAQ.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2911" rel="nofollow">LOG4J2-2911</a>:<br /> |
| Log4j2EventListener in spring.cloud.config.client listens for wrong event.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2919" rel="nofollow">LOG4J2-2919</a>:<br /> |
| Call ReliabilityStrategy's beforeStopAppenders() method before stopping AsyncAppender. Thanks to Geng Yuanzhe.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2906" rel="nofollow">LOG4J2-2906</a>:<br /> |
| Fix UnsupportedOperationException when initializing the Log4j2CloudConfigLoggingSystem. Thanks to Stephen Joyner.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2908" rel="nofollow">LOG4J2-2908</a>:<br /> |
| Move Spring Lookup and Spring PropertySource to its own module.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2910" rel="nofollow">LOG4J2-2910</a>:<br /> |
| Log4j-web should now stores the servlet context as a map entry instead of in the single external context field.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2822" rel="nofollow">LOG4J2-2822</a>:<br /> |
| Javadoc link in ThreadContext description was incorrect.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2894" rel="nofollow">LOG4J2-2894</a>:<br /> |
| Fix spelling error in log message.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2901" rel="nofollow">LOG4J2-2901</a>:<br /> |
| Missing configuration files should be ignored when creating a composite configuration.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2883" rel="nofollow">LOG4J2-2883</a>:<br /> |
| When using DirectFileRolloverStrategy the file pattern was not being recalculated on<br /> |
| size based rollover after a time based rollover had occurred.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2875" rel="nofollow">LOG4J2-2875</a>:<br /> |
| Rollover was failing to create directories when using a DirectFileeRolloverStrategy.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2859" rel="nofollow">LOG4J2-2859</a>:<br /> |
| Fixed typos where mergeFactory should be mergeStrategy. Thanks to Yanming Zhou.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2832" rel="nofollow">LOG4J2-2832</a>:<br /> |
| Correct class name printed in error message in RollingFileAppender. Thanks to Benjamin Asbach.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2882" rel="nofollow">LOG4J2-2882</a>:<br /> |
| Support java.util.logging filters when using that API. Thanks to Emmanuel Bourg.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2880" rel="nofollow">LOG4J2-2880</a>:<br /> |
| Create StackWalker benchmark. Revert back to StackWalker.walk based on benchmark results.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2867" rel="nofollow">LOG4J2-2867</a>:<br /> |
| Obtain ContextDataProviders asynchronously.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2877" rel="nofollow">LOG4J2-2877</a>:<br /> |
| Determine the container id to obtain container and image information.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2844" rel="nofollow">LOG4J2-2844</a>:<br /> |
| Null pointer exception when no network interfaces are available.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2895" rel="nofollow">LOG4J2-2895</a>:<br /> |
| Fix potential deadlock in asynchronous logging by avoiding blocking for queue space on Log4jThreads</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2837" rel="nofollow">LOG4J2-2837</a>:<br /> |
| Disruptor and JUL no longer recursively start the AsyncLoggerDisruptor<br /> |
| resulting in an extra disruptor background thread constantly waiting.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2867" rel="nofollow">LOG4J2-2867</a>:<br /> |
| RingBufferLogEventTranslator uses a static ContextDataInjector instead of initializing a new object<br /> |
| on each thread.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2898" rel="nofollow">LOG4J2-2898</a>:<br /> |
| Avoid initializing volatile fields with default values. Thanks to Turbanov Andrey.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2899" rel="nofollow">LOG4J2-2899</a>:<br /> |
| Fix log4j-1.2-api LogEventWrapper threadId and priority accessors when called multiple times.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2939" rel="nofollow">LOG4J2-2939</a>:<br /> |
| Fix NPE in MDCContextMap on 'contains' and 'isEmpty' invocations. Thanks to Constantin Hirsch.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2954" rel="nofollow">LOG4J2-2954</a>:<br /> |
| Prevent premature garbage collection of shutdown hooks in DefaultShutdownCallbackRegistry. Thanks to Henry Tung.</li> |
| </ul> |
| <h3><a id="user-content-changes" class="anchor" aria-hidden="true" href="#changes"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"> |
| <path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Changes</h3> |
| <ul> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2889" rel="nofollow">LOG4J2-2889</a>:<br /> |
| Add date pattern support for HTML layout. Thanks to Geng Yuanzhe.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow">LOG4J2-2892</a>:<br /> |
| Allow GelfLayout to produce newline delimited events. Thanks to Jakub Lukes.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update MongoDB tests to require Java 8 unconditionally now that Log4j requires Java 8.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update mongodb3.version from 3.12.1 to 3.12.6.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update com.fasterxml.jackson.* 2.10.2 -> 2.11.0.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update org.apache.activemq:activemq-broker 5.15.11 -> 5.16.0.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update org.apache.commons:commons-compress 1.19 -> 1.20.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update org.apache.commons:commons-csv 1.7 -> 1.8.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update org.apache.commons:commons-lang3 3.9 -> 3.10.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update org.codehaus.groovy:* 2.5.6 -> 3.0.5.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update tests junit:junit 4.12 -> 4.13.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update tests commons-io:commons-io 2.6 -> 2.7.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update jackson 2.11.0 -> 2.11.2.</li> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2892" rel="nofollow"></a>:<br /> |
| Update tests hsqldb 2.5.0 -> 2.5.1.</li> |
| </ul> |
| <h3><a id="user-content-removed" class="anchor" aria-hidden="true" href="#removed"><svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"> |
| <path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a>Removed</h3> |
| <ul> |
| <li><a href="https://issues.apache.org/jira/browse/LOG4J2-2851" rel="nofollow">LOG4J2-2851</a>:<br /> |
| Drop log4j-mongodb2 module.</li> |
| </ul> |
| <hr> |
| <p>Apache Log4j 2.14.0 requires a minimum of Java 8 to build and run. Log4j 2.12.1 is the last release to support<br /> |
| Java 7.</p> |
| <p>For complete information on Apache Log4j 2, including instructions on how to submit bug<br /> |
| reports, patches, or suggestions for improvement, see the Apache Apache Log4j 2 website:</p> |
| <p><a href="https://logging.apache.org/log4j/2.x/" rel="nofollow">https://logging.apache.org/log4j/2.x/</a></p> |