////
    Licensed to the Apache Software Foundation (ASF) under one or more
    contributor license agreements.  See the NOTICE file distributed with
    this work for additional information regarding copyright ownership.
    The ASF licenses this file to You under the Apache License, Version 2.0
    (the "License"); you may not use this file except in compliance with
    the License.  You may obtain a copy of the License at

         https://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
////

= 2.5 (2015-12-06)

This is the ninth GA release.
It contains several bugfixes and new features.
The new features include the ability to specify delete actions during file rollover, a CRON-based
triggering policy for file rollover, support for JSR 223 scripts in filters, pattern selectors and delete actions, and a policy for removing idle appenders from the `RoutingAppender`.
More details on the features and bugfixes are itemized below.

Log4j 2.5 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 http://logging.apache.org/log4j/2.x/[the Apache Log4j 2 website].


[#release-notes-2-5-added]
=== Added

* Add support for JSR 223 scripts in filters and the PatternSelector. (https://issues.apache.org/jira/browse/LOG4J2-1136[LOG4J2-1136])
* Add getters for source and destination file in file rename action. (https://issues.apache.org/jira/browse/LOG4J2-1168[LOG4J2-1168])
* Add getters for classes in org.apache.logging.log4j.core.appender.rolling.action. (https://issues.apache.org/jira/browse/LOG4J2-1175[LOG4J2-1175])
* Support use-case for JDBC's CommonDataSource.setLogWriter(PrintWriter) and java.sql.DriverManager.setLogWriter(PrintWriter). (https://issues.apache.org/jira/browse/LOG4J2-1178[LOG4J2-1178])
* Support use case for java.sql.DriverManager.setLogStream(PrintStream). (https://issues.apache.org/jira/browse/LOG4J2-1187[LOG4J2-1187])
* Added support for custom delete actions triggered by a rollover. (https://issues.apache.org/jira/browse/LOG4J2-435[LOG4J2-435])
* Added system property to allow users to control whether messages should be formatted in the background. (https://issues.apache.org/jira/browse/LOG4J2-898[LOG4J2-898])
* Allow rollover to occur at any time. Add CronTriggeringPolicy. (https://issues.apache.org/jira/browse/LOG4J2-89[LOG4J2-89])

[#release-notes-2-5-changed]
=== Changed

* Update Jackson from 2.6.2 to 2.6.3. (https://issues.apache.org/jira/browse/LOG4J2-1174[LOG4J2-1174])
* Remove ConfigurationMonitor. The WatchManager is now used to check for configuration changes. (https://issues.apache.org/jira/browse/LOG4J2-1202[LOG4J2-1202])
* Update kafka-clients from 0.8.2.2 to 0.9.0.0. (https://issues.apache.org/jira/browse/LOG4J2-1207[LOG4J2-1207])
* Add PurgePolicy and IdlePurgePolicy to RoutingAppender. (https://issues.apache.org/jira/browse/LOG4J2-649[LOG4J2-649])

[#release-notes-2-5-fixed]
=== Fixed

* Performance improvement when gathering location information. (https://issues.apache.org/jira/browse/LOG4J2-1029[LOG4J2-1029])
* Web site corrections and updates. (https://issues.apache.org/jira/browse/LOG4J2-1156[LOG4J2-1156])
* Fix compilation error for classes annotated with @Plugin. (https://issues.apache.org/jira/browse/LOG4J2-1157[LOG4J2-1157])
* Log4J JUL adapter is using MessageFormat on String passed by java.util.function.Supplier<String>. (https://issues.apache.org/jira/browse/LOG4J2-1158[LOG4J2-1158])
* Fixed a ThreadLocal memory leak in Tomcat8 that mentions AsyncLoggers when Async Loggers are not used. (https://issues.apache.org/jira/browse/LOG4J2-1159[LOG4J2-1159])
* Improve Log4j initialization status messages. (https://issues.apache.org/jira/browse/LOG4J2-1165[LOG4J2-1165])
* AbstractConfiguration executor should use a DaemonThreadFactory. (https://issues.apache.org/jira/browse/LOG4J2-1166[LOG4J2-1166])
* Use servlet context name for logger context name when available. (https://issues.apache.org/jira/browse/LOG4J2-1171[LOG4J2-1171])
* Fixed ThreadLocal leak [AsyncLogger$Info] on Tomcat when using AsyncLoggerContextSelector. (https://issues.apache.org/jira/browse/LOG4J2-1172[LOG4J2-1172])
* Fixed rollover error when copying to a directory mapped to a remote Linux host. (https://issues.apache.org/jira/browse/LOG4J2-1173[LOG4J2-1173])
* Fixed memory leak when log4j jars are in Tomcat's lib folder. (https://issues.apache.org/jira/browse/LOG4J2-1176[LOG4J2-1176])
* Logger cache does not account for message factory. (https://issues.apache.org/jira/browse/LOG4J2-1180[LOG4J2-1180])
* Prefix all thread names Log4j creates with "Log4j2-". (https://issues.apache.org/jira/browse/LOG4J2-1193[LOG4J2-1193])
* Documentation does not match parameters for LoggerNameLevelRewritePolicy. (https://issues.apache.org/jira/browse/LOG4J2-1194[LOG4J2-1194])
* Make KafkaAppender support SerializedLayout. (https://issues.apache.org/jira/browse/LOG4J2-1195[LOG4J2-1195])
* MongoDbConnection does not close MongoClient. (https://issues.apache.org/jira/browse/LOG4J2-1196[LOG4J2-1196])
* Better web app support for async loggers: Fixed a memory leak that occurred when the logging jars are placed in the container's classpath and the configuration file uses AsyncRoot/AsyncLogger. The problem was that the first web application started the Disruptor background thread [AsyncLoggerConfig-1] but did not stop it until all web apps are stopped. Each web application now has its own Disruptor which is stopped/started together with the web app. (https://issues.apache.org/jira/browse/LOG4J2-323[LOG4J2-323])
* Reduced memory usage of status messages in bounded queue; support zero-length queue that stores no messages. (https://issues.apache.org/jira/browse/LOG4J2-324[LOG4J2-324])
* Allow triggering policy and rollover strategy to be modified during reconfiguration. (https://issues.apache.org/jira/browse/LOG4J2-381[LOG4J2-381])
* Better web app support for async loggers: it is now possible to place the logging jars in the container's classpath when making all loggers asynchronous by using AsyncLoggerContextSelector. This fixes a problem where logging would stop working after stopping and restarting a web application. (https://issues.apache.org/jira/browse/LOG4J2-493[LOG4J2-493])
* org.apache.logging.log4j.core.Logger should be serializable. (https://issues.apache.org/jira/browse/LOG4J2-801[LOG4J2-801])
* Fixed bug where omitting the <display-name> element in web.xml caused incorrect log4j initialization, resulting in memory leaks when the web application was stopped or reloaded. (https://issues.apache.org/jira/browse/LOG4J2-873[LOG4J2-873])
* Documentation: fixed minor issues with the site and manual pages. (https://issues.apache.org/jira/browse/LOG4J2-879[LOG4J2-879])
* Fix plugin documentation error about Converters. (https://issues.apache.org/jira/browse/LOG4J2-948[LOG4J2-948])
* RollingFileAppender should also roll over when log event time is equal to rollover time, not only when later. (https://issues.apache.org/jira/browse/LOG4J2-999[LOG4J2-999])
