logger.error(null, “This is the log message”, throwable);
2.6.1
- Release date
-
2016-06-05
This is the eleventh GA release. It is primarily a bugfix release. More details on the fixes are itemized below.
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:
or similar with any log level you will get a compiler error saying the reference is ambiguous. To correct this either do:
logger.error(“This is the log message”, throwable);
or
logger.error((Marker) null, “This is the log message”, throwable);
Log4j 2.6.1 maintains binary compatibility with previous releases.
Log4j 2.6.1 requires a minimum of Java 7 to build and run. Log4j 2.3 was the last release that supported Java 6.
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.
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.
Added
-
Added documentation about plugin builders compared to factories. (LOG4J2-1411)
Changed
-
(GC) CSV layouts should not create a new CSVPrinter for each log event. Requires Apache Commons CSV 1.4. (LOG4J2-1385)
-
Update liquibase-core from 3.4.2 to 3.5.1. (LOG4J2-1398)
-
Update Apache Commons CSV from 1.3 to 1.4. (LOG4J2-1399)
Fixed
-
Changed RenameAction to use java.nio to better report rename failures. (LOG4J2-1032)
-
Logger cache now accounts for message factory. (LOG4J2-1180)
-
Fixed minor issues with the 2.6 website. (LOG4J2-1394)
-
Fix regression in properties configuration to support arbitrary component ids. (LOG4J2-1402)
-
OnStartupTriggeringPolicy was forcing a rollover of empty files at startup and would append a second footer that was added by the prior shutdown. (LOG4J2-1405)
-
Fixed bug in ReusableParameterizedMessage where Throwable was never updated so first error was logged over and over again and subsequent errors were not logged. (LOG4J2-1406)
-
Fixed misleading WARN log events from Log4j about message factories and unexpected formatting. (LOG4J2-1407)
-
Added the module log4j-liquibase to BOM POM. (LOG4J2-1408)
-
Fixed ArrayIndexOutOfBoundsException that may occur in ReusableParameterizedMessage. (LOG4J2-1409)
-
Add filter and remove filter were not working properly in AbstractFilterable. (LOG4J2-997)