| --- |
| layout: post |
| title: Log4j 2.6.2 released |
| date: '2016-07-10T00:00:00+00:00' |
| categories: logging |
| --- |
| <img src="http://logging.apache.org/log4j/2.x/images/logo.png" />
|
| <p>The Apache Log4j 2 team is pleased to announce the Log4j 2.6.2 release!</p>
|
|
|
| <p>
|
| Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade
|
| to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides
|
| many other modern features such as support for Markers, lambda expressions for lazy logging,
|
| property substitution using Lookups, multiple patterns on a PatternLayout and asynchronous
|
| Loggers. Another notable Log4j 2 feature is the ability to be "garbage-free" (avoid allocating
|
| temporary objects) while logging. In addition, Log4j 2 will not lose events while reconfiguring.
|
| </p><p>
|
| This is the twelfth GA release. It is primarily a bugfix release. More details on the
|
| fixes are itemized below.
|
| </p><p>
|
| Note that subsequent to the 2.6 release a minor source incompatibility was found due to the
|
| addition of new methods to the Logger interface. If you have code that does:
|
| </p><p>
|
|
|
| <tt>logger.error(null, “This is the log message”, throwable);</tt>
|
| </p><p>
|
|
|
| or similar with any log level you will get a compiler error saying the reference is ambiguous.
|
| To correct this either do:
|
| </p><p>
|
|
|
| <tt>logger.error(“This is the log message”, throwable);</tt>
|
|
|
| </p><p>
|
| or
|
| </p><p>
|
|
|
| <tt>logger.error((Marker) null, “This is the log message”, throwable);</tt>
|
| </p><p>
|
|
|
| Log4j 2.6.2 maintains binary compatibility with previous releases.
|
| </p><p>
|
|
|
| <h2>GA Release 2.6.2</h2>
|
|
|
| <p>
|
| Changes in this version include:
|
| </p><p>
|
|
|
| New features:
|
| </p>
|
|
|
| <ul>
|
| <li> LOG4J2-1395: Add "direct" option to ConsoleAppender for increased performance.
|
| <li> LOG4J2-1437: (GC) ObjectMessage and ReusableObjectMessage now avoid calling toString() on auto-boxed primitive parameters.
|
| <li> LOG4J2-1415: (GC) ParameterFormatter now avoids calling toString() on auto-boxed primitive message parameters.
|
| <li> LOG4J2-1412: Unbox utility's ringbuffer of StringBuilders is now configurable.
|
| </ul>
|
|
|
| <p>Fixed Bugs:</p>
|
| <ul>
|
| <li> LOG4J2-904: If copy and delete fails in rename action then resort to truncating the source file after copying it. Thanks to Bernhard Mähr.
|
| <li> LOG4J2-1250: CronTriggeringPolicy was not properly setting the prevFileTime value for the PatternProcessor so
|
| file dates and times on rolled files were incorrect.
|
| <li> LOG4J2-1452: Fixed issue where reusable messages broke flow tracing logic. Thanks to Mikael Ståldal.
|
| <li> LOG4J2-1440: Fix bug in OnStartupTriggeringPolicy that allowed it to roll over on every reconfiguration. Added
|
| minSize attribute.
|
| <li> LOG4J2-1414: Fixed minor issues with the 2.6.1 web site. Thanks to Ralph Goers.
|
| <li> LOG4J2-1434: Ensure that the thread-local StringBuilders used by Layouts to format log events to text will not
|
| retain excessive memory after a large message was logged. Thanks to Luke Butters.
|
| <li> LOG4J2-1418: Provide MessageFactory2 to custom Logger implementations.
|
| <li> LOG4J2-1420: RollingRandomAccessFileManager was not properly rolling over on startup and was getting a NullPointerException.
|
| <li> LOG4J2-1417: Fixed issue where Unbox utility ignored the value Constants.ENABLE_THREADLOCALS and always stored non-JDK classes in ThreadLocals.
|
| <li> LOG4J2-1422: Fixed issue where AsyncAppenderQueueFullPolicyTest sometimes hangs.
|
| <li> LOG4J2-1445: OnStartupTriggeringPolicyTest fails on Windows saying the file is used by another process. Thanks to Ludovic HOCHET.
|
| </ul>
|
| <p>Changes:</p>
|
| <ul>
|
| <li> LOG4J2-1432: Update Jackson from 2.7.4 to 2.7.5.
|
| <li> LOG4J2-1433: Update Jansi from 1.11 to 1.13.
|
| <li> LOG4J2-1444: Update Apache Commons Compress from 1.11 to 1.12.
|
| </ul>
|
|
|
|
|
| <p>Apache Log4j 2.6.2 requires a minimum of Java 7 to build and run. Log4j 2.3 was the last release that
|
| supported Java 6.</p>
|
|
|
| <p>Basic compatibility with Log4j 1.x is provided through the log4j-1.2-api component, however it does not implement some of the
|
| very implementation specific classes and methods. The package names and Maven groupId have been changed to
|
| org.apache.logging.log4j to avoid any conflicts with log4j 1.x.</p>
|
|
|
| <p>For complete information on Apache Log4j 2, including instructions on how to submit bug reports,
|
| patches, or suggestions for improvement, see the Apache Apache Log4j 2 website:
|
| </p>
|
| <p>
|
| <a href="http://logging.apache.org/log4j/2.x/">http://logging.apache.org/log4j/2.x/</a>
|
| </p> |