The Apache Log4j team is pleased to announce the `2.25.0`
release. Apache Log4j is a versatile, industrial-strength
Java logging framework composed of an API, its implementation,
and components to assist the deployment for various use cases.
For further information (support, download, etc.) see the project
website:

   https://logging.apache.org/log4j/2.x/index.html

Download page: https://logging.apache.org/log4j/2.x/download.html

Release Notes
-------------

This minor release introduces bug fixes, behavior improvements, and
complete support for GraalVM native image generation.

GraalVM Reachability Metadata
-----------------------------

Log4j Core and all extension modules now include embedded GraalVM
reachability metadata [1], enabling seamless generation of native
images with GraalVM out of the box—no manual configuration required.
For more information, refer to our GraalVM guide [2].

Note:

When building third-party Log4j plugins, using the new
`GraalVmProcessor` introduced in version `2.25.0` will automatically
generate the required reachability metadata for GraalVM native images.
However, the processor will fail the build if the required
`log4j.graalvm.groupId` and `log4j.graalvm.artifactId` parameters are
not provided. For detailed instructions, see Registering plugins [3].

Exception Handling in Pattern Layout
------------------------------------

Exception handling in Pattern Layout [4] has undergone a significant
rewrite. This update resolves several bugs and ensures consistent
behavior across all exception converters. Key improvements include:

* Stack traces are now consistently prefixed with a newline.
* The default exception converter has changed from extended [5] to
  plain [6], offering better performance.
* Support for the `{ansi}` option in exception converters has been
  removed.

Date & Time Formatting
----------------------

Log4j has historically provided custom date and time formatters for
performance, such as FixedDateFormat [7] and FastDateFormat [8]. These
are now deprecated in favor of Java’s standard DateTimeFormatter [9].

If you encounter formatting issues after upgrading—particularly with `n`
or `x` directives—you can temporarily revert to the legacy formatters by
setting the `log4j2.instantFormatter` property to `legacy` [10]. Please
report any issues via our issue tracker [11].

ANSI Support on Windows
------------------------

Modern Windows versions (10 and newer) provide native ANSI escape
sequence support. As a result, dependency on the outdated JAnsi 1.x
library has been removed. For details, refer to ANSI styling on Windows
[12].

Jakarta JMS Appender
---------------------

A Jakarta-compatible version of the JMS Appender [13] is now included in
the core distribution.

Detailed release notes
-----------------------

For all the changes in this release, see the website [14].

Links:
[1] https://www.graalvm.org/latest/reference-manual/native-image/metadata/
[2] https://logging.apache.org/log4j/2.x/manual/graalvm.html
[3]
https://logging.apache.org/log4j/2.x/manual/plugins.html#plugin-registry
[4]
https://logging.staged.apache.org/log4j/2.25.0/manual/pattern-layout.html
[5]
https://logging.apache.org/log4j/2.x/manual/pattern-layout.html#converter-exception-extended
[6]
https://logging.apache.org/log4j/2.x/manual/pattern-layout.html#converter-exception
[7]
https://logging.apache.org/log4j/2.x/javadoc/log4j-core/org/apache/logging/log4j/core/util/datetime/FixedDateFormat.html
[8]
https://logging.apache.org/log4j/2.x/javadoc/log4j-core/org/apache/logging/log4j/core/util/datetime/FastDateFormat.html
[9]
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
[10]
https://logging.apache.org/log4j/2.x/manual/systemproperties.html#log4j2.instantFormatter
[11] https://logging.apache.org/logging-services/support.html#issues
[12]
https://logging.apache.org/log4j/2.x/manual/pattern-layout.html#jansi
[13]
https://logging.apache.org/log4j/2.x/manual/appenders/message-queue.html#JmsAppender
[14]
https://logging.apache.org/log4j/2.x/release-notes.html#release-notes-2-25-0

Reply via email to