2.19.0 (2022-09-09)

This release primarily contains bug fixes 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. SLF4J-2.0.0 alpha releases are not fully supported. See LOG4J2-2975 and SLF4J-511.

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

Apache Log4j 2.19.0 requires a minimum of Java 8 to build and run. Log4j 2.12.4 is the last release to support Java 7. Log4j 2.3.2 is the last release to support Java 6. Java 6 and Java 7 are no longer supported by the Log4j team.

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

  • Add implementation of SLF4J2 fluent API. (for LOG4J2-2975 by Piotr P. Karwasz, Daniel Gray)

  • Add support for SLF4J2 stack-valued MDC. (for LOG4J2-3583 by Piotr P. Karwasz, Pierrick Terrettaz)

Changed

  • Add getExplicitLevel method to LoggerConfig. (for LOG4J2-3572 by Ralph Goers)

  • Allow PropertySources to be added. (for LOG4J2-3588 by Ralph Goers)

  • Allow Plugins to be injected with the LoggerContext reference. (for LOG4J2-3589 by Ralph Goers)

Removed

  • Removed build page in favor of a single build instructions file. (for LOG4J2-3573 by Volkan Yazıcı, Wolff Bock von Wuelfingen)

  • Remove SLF4J 1.8.x binding. (for LOG4J2-3590 by Piotr P. Karwasz)

Fixed

  • Add correct manifest entries for OSGi to log4j-jcl (for LOG4J2-3545 by Piotr P. Karwasz, Johan Compagner)

  • Improve support for passwordless keystores. (for LOG4J2-3548 by Piotr P. Karwasz, Kristof Farkas-Pall)

  • SystemPropertyArbiter was assigning the value as the name. (for LOG4J2-3550 by Ralph Goers, DongjianPeng)

  • Make JsonTemplateLayout stack trace truncation operate for each label block. (for LOG4J2-3556 by Volkan Yazıcı, Arthur Gavlyukovskiy)

  • Fix recursion between Log4j 1.2 LogManager and Category. (for LOG4J2-3557 by Piotr P. Karwasz, Andreas Leitgeb)

  • Fix resolution of properties not starting with log4j2.. (for LOG4J2-3559 by Piotr P. Karwasz, Gary Gregory)

  • Logger$PrivateConfig.filter(Level, Marker, String) was allocating empty varargs array. (for LOG4J2-3560 by Carter Kozak, David Schlosnagle)

  • Allows a space separated list of style specifiers in the %style pattern for consistency with %highlight. (for LOG4J2-3561 by Piotr P. Karwasz, Robert Papp)

  • Fix NPE in log4j-to-jul in the case the root logger level is null. (for LOG4J2-3564 by Piotr P. Karwasz)

  • Fix RollingRandomAccessFileAppender with DirectWriteRolloverStrategy can’t create the first log file of different directory. (for LOG4J2-3565 by Piotr P. Karwasz, Su Pei Tao)

  • Generate new SSL certs for testing. (for LOG4J2-3578 by Ralph Goers)

  • Fix ServiceLoaderUtil behavior in the presence of a SecurityManager. (for LOG4J2-3579 by Piotr P. Karwasz, Boris Unckel)

  • Make StatusConsoleListener use SimpleLogger internally. (for LOG4J2-3584 by Volkan Yazıcı)

  • Fix regression in Rfc5424Layout default values. (for LOG4J2-3587 by Piotr P. Karwasz, Tomas Micko)

  • Harden InstantFormatter against delegate failures. (for LOG4J2-3614 by Volkan Yazıcı, strainu)

  • Add async support to Log4jServletFilter. (for LOG4J2-708 by Piotr P. Karwasz)