2.13.1 (2020-02-25)

This release contains bugfixes and minor enhancements.

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.

Note that the XML, JSON and YAML formats changed in the 2.11.0 release: they no longer have the timeMillis attribute and instead have an Instant element with epochSecond and nanoOfSecond attributes.

The Log4j 2.13.1 API, as well as many core components, maintains binary compatibility with previous releases.

Log4j 2.13.1 requires a minimum of Java 8 to build and run. Log4j 2.3 was the last release that supported Java 6 and Log4j 2.11.2 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.



  • Implement ISO8601_PERIOD_MICROS fixed date format matching ISO8601_PERIOD with support for microsecond precision. (for LOG4J2-2748 by Carter Kozak)


  • Update log4j-slf4j18-impl slf4j version to 1.8.0-beta4 from 1.8.0-alpha2. (for LOG4J2-2745 by Carter Kozak)

  • Update dependencies. (for LOG4J2-2763 by Gary Gregory)

  • Add a retry count attribute to the KafkaAppender. (for LOG4J2-2777 by Ralph Goers, joongs4)

  • Use LinkedBlockingQueue instead of synchronized collection in StatusConfiguration. (for LOG4J2-2782 by Ralph Goers)

  • Conditionally perform status logging calculations in PluginRegistry. (for LOG4J2-2789 by Ralph Goers, Marius Volkhart)


  • Rollover fails when file matches pattern but index is too large. (for LOG4J2-2039 by Ralph Goers)

  • Allow Lookup keys with leading dashes by using a slash as an escape character. (for LOG4J2-2211 by Ralph Goers)

  • Fix lock contention in the classloader using new versions of slf4j without EventData on slf4j logger creation. (for LOG4J2-2415 by Carter Kozak, Andrey Turbanov)

  • CronExpression.getBeforeTime() would sometimes return incorrect result. (for LOG4J2-2575 by Ralph Goers, Nathan Friess)

  • GraalVM does not allow use of MethodHandles. (for LOG4J2-2649 by Ralph Goers)

  • JSON output wrong when using additional fields. (for LOG4J2-2652 by Ralph Goers)

  • PluginProcessor should use Messager instead of System.out. (for LOG4J2-2676 by Ralph Goers, Gregg Donovan)

  • Rollover handles parallel file deletion gracefully. (for LOG4J2-2677 by Carter Kozak)

  • MapMessage.getFormattedMessage() would incorrectly format objects. (for LOG4J2-2703 by Ralph Goers, Volkan Yazici)

  • Slow initialization on Windows due to accessing network interfaces. (for LOG4J2-2717 by Ralph Goers)

  • PluginCache output is reproducible allowing the annotation processor to produce deterministic results. (for LOG4J2-2735 by Carter Kozak, Andy Wilkinson)

  • Fix erroneous log4j-jul recursive logger detection resulting in some no-op JUL loggers and 'WARN Recursive call to getLogger' being reported by the status logger. (for LOG4J2-2739 by Carter Kozak)

  • Remove unnecessary EventLogger references from log4j-slf4j18-impl due to removal from slf4j. (for LOG4J2-2744 by Carter Kozak)

  • ClassLoaderContextSelector was not locating the LoggerContext during shutdown. (for LOG4J2-2746 by Ralph Goers)

  • Fix a memory leak using fully asynchronous logging when the queue is full using the 'discard' asynchronous queue full strategy. (for LOG4J2-2747 by Carter Kozak)

  • Fix StackLocator.getCallerClass performance in cases where Reflection.getCallerClass is not accessible. (for LOG4J2-2751 by Carter Kozak)

  • MutableLogEvent and RingBufferLogEvent avoid StringBuffer and parameter array allocation unless reusable messages are used. (for LOG4J2-2752 by Carter Kozak)

  • LoaderUtil.getClassLoaders may discover additional loaders and no longer erroneously returns a result with a null element in some environments. (for LOG4J2-2754 by Carter Kozak)

  • Prevent LoggerContext from being garbage collected while being created. (for LOG4J2-2756 by Ralph Goers)

  • NullPointerException when using a custom DirectFileRolloverStrategy without a file name. (for LOG4J2-2758 by Ralph Goers, Christoph Kaser)

  • RollingFileAppender was not rolling on startup if createOnDemand was set to true. (for LOG4J2-2759 by Ralph Goers)

  • Always write header on a new OutputStream. (for LOG4J2-2760 by Ralph Goers, Christoph Kaser)

  • [JDBC] MS-SQL Server JDBC driver throws SQLServerException when inserting a null value for a VARBINARY column. (for LOG4J2-2762 by Gary Gregory)

  • Warn if pattern is missing on Routes element. Use default route. (for LOG4J2-2767 by Ralph Goers)

  • Add multi-parameter overloads to LogBuilder. (for LOG4J2-2768 by Ralph Goers, Marius Volkhart)

  • Do not log an error if Files.move does not work. (for LOG4J2-2769 by Ralph Goers)

  • Fixed NullPointerException after reconfiguring via JMX. (for LOG4J2-2770 by Ralph Goers, Bill Kuker)

  • NullPointerException after reconfiguring via JMX. (for LOG4J2-2770 by Gary Gregory, Bill Kuker)

  • An error message in RollingFileAppender uses a placeholder for the name but does not specify the name argument in the logging call (for LOG4J2-2776 by Ralph Goers, Christoph Kaser)

  • ServletContainerInitializer was obtaining the StatusLogger too soon. (for LOG4J2-2781 by Ralph Goers, qxo)

  • Counter stuck at 10 and overwriting files when leading zeros used in the file pattern count. (for LOG4J2-2784 by Ralph Goers)