Skip to content
Commits on Source (7)
......@@ -14,9 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
# Apache Log4j 2.11.1 Release Notes
# Apache Log4j 2.11.2 Release Notes
The Apache Log4j 2 team is pleased to announce the Log4j 2.11.1 release!
The Apache Log4j 2 team is pleased to announce the Log4j 2.11.2 release!
Apache Log4j is a well known framework for logging application behavior. Log4j 2 is an upgrade
to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and provides
......@@ -25,7 +25,9 @@ property substitution using Lookups, multiple patterns on a PatternLayout and as
Loggers. Another notable Log4j 2 feature is the ability to be "garbage-free" (avoid allocating
temporary objects) while logging. In addition, Log4j 2 will not lose events while reconfiguring.
This release contains new features, bugfixes and minor enhancements.
The artifacts may be downloaded from https://logging.apache.org/log4j/2.x/download.html.
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
......@@ -35,12 +37,18 @@ As of Log4j 2.9.0, the Log4j API was modified to use java.util.ServiceLoader to
although the former binding mechanism is still supported. The Log4j API jar is now a multi-release jar
to provide implementations of Java 9 specific classes. Multi-release jars are not supported by
the OSGi specification so OSGi modules will not be able to take advantage of these implementations
but will not lose functionality as they will fall back to the implementations used in Java 7 and 8.
More details on the new features and fixes are itemized below. Note that some tools are not compatible
but will not lose functionality as they will fall back to the implementations used in Java 7 and 8. Applications
using Spring Boot must add the Multi-Release header to the jar manifest or the Java 9+ classes will be
ignored.
More details on the fixes are itemized below. Note that some tools are not compatible
with multi-release jars and may fail trying to process class files in the META-INF/versions/9 folder.
Those errors should be reported to the tool vendor.
Note that subsequent to the 2.9.0 release, for security reasons, SerializedLayout is deprecated and no
Note that subsequent to the 2.9.0 release, for security reasons, Log4j does not process DTD in XML files.
If you used DTD for including snippets, you have to use XInclude or Composite Configuration instead.
Also subsequent to the 2.9.0 release, for security reasons, SerializedLayout is deprecated and no
longer used as default in the Socket and JMS appenders. SerializedLayout can still be used as before,
but has to be specified explicitly. To retain old behaviour, you have to change configuration like:
......@@ -64,126 +72,133 @@ We do, however, discourage the use of SerializedLayout and recommend JsonLayout
</Socket>
</Appenders>
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.
Note that subsequent to the 2.9.0 release, for security reasons, Log4j does not process DTD in XML files.
If you used DTD for including snippets, you have to use XInclude or Composite Configuration instead.
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.11.1 API, as well as many core components, maintains binary compatibility with previous releases.
The Log4j 2.11.2 API, as well as many core components, maintains binary compatibility with previous releases.
## GA Release 2.11.1
## GA Release 2.11.2
Changes in this version include:
### New Features
* [LOG4J2-2496](https://issues.apache.org/jira/browse/LOG4J2-2496):
JDBC Appender should reconnect to the database when a connection goes stale.
* [LOG4J2-2505](https://issues.apache.org/jira/browse/LOG4J2-2505):
Let JDBC PoolingDriverConnectionSource with Apache Commons DBCP configure a PoolableConnectionFactory.
* [LOG4J2-2509](https://issues.apache.org/jira/browse/LOG4J2-2509):
Allow a JDBC Appender to truncate strings to match a table's metadata column length limit.
* [LOG4J2-1246](https://issues.apache.org/jira/browse/LOG4J2-1246):
PatternLayout %date conversion pattern should render time zone designator for ISO-ISO8601.
### Fixed Bugs
* [LOG4J2-2389](https://issues.apache.org/jira/browse/LOG4J2-2389):
ThrowableProxy was saving and retrieving cache entries using different keys. Thanks to Liu Wen.
* [LOG4J2-2316](https://issues.apache.org/jira/browse/LOG4J2-2316):
If root LoggerConfig does not have a Level return ERROR.
* [LOG4J2-2390](https://issues.apache.org/jira/browse/LOG4J2-2390):
Fix broken links in log4j web documentation. Thanks to anton-balaniuc.
* [LOG4J2-2343](https://issues.apache.org/jira/browse/LOG4J2-2343):
The OSGi Activator specified an incorrect version. Thanks to Raymond Augé.
* [LOG4J2-2305](https://issues.apache.org/jira/browse/LOG4J2-2305):
Make java.util.ServiceLoader properly work in OSGi by using the Service Loader Mediator Specification. Thanks to Björn Kautler.
* [LOG4J2-2305](https://issues.apache.org/jira/browse/LOG4J2-2305):
Split the SLF4J binding into 2 implementations - one for SLF4J 1.7.x and one for SLF4J 1.8+.
* [LOG4J2-2268](https://issues.apache.org/jira/browse/LOG4J2-2268):
Improve plugin error message when elements are missing. Thanks to Tilman Hausherr.
* [LOG4J2-2283](https://issues.apache.org/jira/browse/LOG4J2-2283):
ParserConfigurationException when using Log4j with oracle.xml.jaxp.JXDocumentBuilderFactory. Thanks to Vishnu Priya Matha.
* [LOG4J2-2300](https://issues.apache.org/jira/browse/LOG4J2-2300):
PoolingDriverConnectionSource does not take into account properties, user name, and password.
* [LOG4J2-2307](https://issues.apache.org/jira/browse/LOG4J2-2307):
MutableLogEvent and RingBufferLogEvent message mementos retain the original format string.
* [LOG4J2-2032](https://issues.apache.org/jira/browse/LOG4J2-2032):
Curly braces in parameters are not treated as placeholders. Thanks to Kostiantyn Shchepanovskyi.
* [LOG4J2-2317](https://issues.apache.org/jira/browse/LOG4J2-2317):
MutableLogEvent.getNonNullImmutableMessage and Log4jLogEvent.makeMessageImmutable retain format and parameters.
* [LOG4J2-2318](https://issues.apache.org/jira/browse/LOG4J2-2318):
Messages are no longer mutated when the asynchronous queue is full. A warning is logged to the status logger instead.
* [LOG4J2-2320](https://issues.apache.org/jira/browse/LOG4J2-2320):
Fix NPE in AbstractLogger when another exception is thrown, masking the root cause.
* [LOG4J2-2321](https://issues.apache.org/jira/browse/LOG4J2-2321):
AsyncLogger uses the correct level when unspecified. This provides parity between AsyncLogger and Logger.
* [LOG4J2-2322](https://issues.apache.org/jira/browse/LOG4J2-2322):
Custom ContextSelector implementations which select an AsyncLoggerContext disable LoggerConfig.includeLocation
by default for parity with AsyncLoggerContextSelector.
* [LOG4J2-2269](https://issues.apache.org/jira/browse/LOG4J2-2269):
MutableLogEvent references to other objects are cleared after each use.
Fix a memory leak causing references to parameters to be held after synchronous logging with thread locals enabled.
* [LOG4J2-2301](https://issues.apache.org/jira/browse/LOG4J2-2301):
Mixed async loggers no longer forget parameter values, providing some appenders with an array of nulls.
* [LOG4J2-2331](https://issues.apache.org/jira/browse/LOG4J2-2331):
RollingFileManager debug logging avoids string concatenation and errant braces in favor of parameterized logging. Thanks to Mike Baranski.
* [LOG4J2-2333](https://issues.apache.org/jira/browse/LOG4J2-2333):
Handle errors thrown in default disruptor ExceptionHandler implementations to avoid killing background threads.
* [LOG4J2-2334](https://issues.apache.org/jira/browse/LOG4J2-2334):
Add API org.apache.logging.log4j.core.appender.AsyncAppender.getQueueSize().
* [LOG4J2-2336](https://issues.apache.org/jira/browse/LOG4J2-2336):
Remove duplicate hyphen from the AsyncLoggerConfig background thread name.
* [LOG4J2-2347](https://issues.apache.org/jira/browse/LOG4J2-2347):
Update Apache Commons Compress from 1.16.1 to 1.17.
* [LOG4J2-2352](https://issues.apache.org/jira/browse/LOG4J2-2352):
RingBufferLogEvent memento messages provide the expected format string, and no longer attempt to substitute parameters into curly braces in parameter toString values.
Both RingBufferLogEvent and MutableLogEvent memento implementations memoize results to avoid rebuilding formatted string values.
* [LOG4J2-2355](https://issues.apache.org/jira/browse/LOG4J2-2355):
PropertiesUtil ignores non-string system properties. Fixes a NoClassDefFoundError initializing StatusLogger
caused by an NPE while initializing the static PropertiesUtil field. Thanks to Henrik Brautaset Aronsen.
* [LOG4J2-2362](https://issues.apache.org/jira/browse/LOG4J2-2362):
Fixed a memory leak in which ReusableObjectMessage would hold a reference to the most recently logged object.
* [LOG4J2-2312](https://issues.apache.org/jira/browse/LOG4J2-2312):
Jackson layouts used with AsyncLoggerContextSelector output the expected format rather than only a JSON string of the message text.
* [LOG4J2-2364](https://issues.apache.org/jira/browse/LOG4J2-2364):
Fixed a memory leak in which ReusableParameterizedMessage would hold a reference to the most recently
logged throwable and provided varargs array.
* [LOG4J2-2368](https://issues.apache.org/jira/browse/LOG4J2-2368):
Nested logging doesn't clobber AbstractStringLayout cached StringBuidlers
* [LOG4J2-2373](https://issues.apache.org/jira/browse/LOG4J2-2373):
StringBuilders.escapeJson implementation runs in linear time. Escaping large JSON strings
in EncodingPatternConverter and MapMessage will perform significantly better. Thanks to Kevin Meurer.
* [LOG4J2-2376](https://issues.apache.org/jira/browse/LOG4J2-2376):
StringBuilders.escapeXml implementation runs in linear time. Escaping large XML strings
in EncodingPatternConverter and MapMessage will perform significantly better. Thanks to Kevin Meurer.
* [LOG4J2-2377](https://issues.apache.org/jira/browse/LOG4J2-2377):
NullPointerException in org.apache.logging.log4j.util.LoaderUtil.getClassLoaders() when using Bootstrap class loader. Thanks to Mirko Rzehak, Gary Gregory.
* [LOG4J2-2382](https://issues.apache.org/jira/browse/LOG4J2-2382):
Update Mongodb 3 driver from 3.6.3 to 3.8.0.
* [LOG4J2-2388](https://issues.apache.org/jira/browse/LOG4J2-2388):
Thread indefinitely blocked when logging a message in an interrupted thread. Thanks to Failled.
* [LOG4J2-2500](https://issues.apache.org/jira/browse/LOG4J2-2500):
Document that Properties element must be the first configuration element.
* [LOG4J2-2543](https://issues.apache.org/jira/browse/LOG4J2-2543):
Add Log4j-to-SLF4J to BOM pom.xml. Thanks to Dermot Hardy.
* [LOG4J2-2061](https://issues.apache.org/jira/browse/LOG4J2-2061):
Use the file pattern as the FileManager "name" when no filename is present.
* [LOG4J2-2009](https://issues.apache.org/jira/browse/LOG4J2-2009):
Expose LoggerContext.setConfiguration as a public method.
* [LOG4J2-2542](https://issues.apache.org/jira/browse/LOG4J2-2542):
CronTriggeringPolicy was not rolling properly, especially when used with the SizeBasedTriggeringPolicy.
* [LOG4J2-2266](https://issues.apache.org/jira/browse/LOG4J2-2266):
Load PropertySources from any accessible ClassLoader. Hide any exceptions that may occur accessing a PropertySource.
* [LOG4J2-1570](https://issues.apache.org/jira/browse/LOG4J2-1570):
Logging with a lambda expression with a method call that also logs would cause logs within method call to reference line num and method name of the parent method.
* [LOG4J2-2485](https://issues.apache.org/jira/browse/LOG4J2-2485):
SizeBasedTriggeringPolicy was not honored when using the DirectWriteRolloverStrategy if the machine restarts. Thanks to Giovanni Matteo Fumarola.
* [LOG4J2-1906](https://issues.apache.org/jira/browse/LOG4J2-1906):
Direct write was creating files with the wrong date/time.
* [LOG4J2-2453](https://issues.apache.org/jira/browse/LOG4J2-2453):
Add Log4j-slf4j18-impl dependency to bom pom. Thanks to theit.
* [LOG4J2-2515](https://issues.apache.org/jira/browse/LOG4J2-2515):
Configuration documentation referenced incorrect method name. Thanks to MakarovS.
* [LOG4J2-2514](https://issues.apache.org/jira/browse/LOG4J2-2514):
Make Strings.toRootUpperCase a static method so it can be accessed. Thanks to smilebrian0515.
* [LOG4J2-1571](https://issues.apache.org/jira/browse/LOG4J2-1571):
Fixed Appenders section in Extending Log4j. Thanks to torbenmoeller.
* [LOG4J2-2397](https://issues.apache.org/jira/browse/LOG4J2-2397):
Predeployment of PersistenceUnit that using Log4j as session logger failed (#198). Thanks to EckelDong.
* [LOG4J2-2365](https://issues.apache.org/jira/browse/LOG4J2-2365):
NameAbbreviator correctly abbreviates first fragments (#188). Thanks to Eugene Zimichev.
* [LOG4J2-2201](https://issues.apache.org/jira/browse/LOG4J2-2201):
Fix memory leak in ReusableParameterizedMessage.
* [LOG4J2-2363](https://issues.apache.org/jira/browse/LOG4J2-2363):
ReusableObjectMessage parameter is properly passed to appenders (#203). Thanks to Brian Laub.
* [LOG4J2-2418](https://issues.apache.org/jira/browse/LOG4J2-2418):
NullPointerException when closing never used RollingRandomAccessFileAppender. Thanks to Jonas Rutishauser.
* [LOG4J2-2422](https://issues.apache.org/jira/browse/LOG4J2-2422):
Handle some unchecked exceptions while loading plugins. Thanks to rswart, Gary Gregory.
* [LOG4J2-2441](https://issues.apache.org/jira/browse/LOG4J2-2441):
Setting a null ErrorHandler on AbstractAppender is not allowed and will no-op as expected.
* [LOG4J2-2444](https://issues.apache.org/jira/browse/LOG4J2-2444):
ErrorHandler is invoked with a LogEvent and Throwable when possible, where previously only a string was used.
* [LOG4J2-2413](https://issues.apache.org/jira/browse/LOG4J2-2413):
Exceptions are added to all columns when a JDBC Appender's ColumnMapping uses a Pattern. Thanks to Andres Luuk, Gary Gregory.
* [LOG4J2-2466](https://issues.apache.org/jira/browse/LOG4J2-2466):
ColumnMapping literal not working. Thanks to Paolo Bonanomi, Gary Gregory.
* [LOG4J2-2478](https://issues.apache.org/jira/browse/LOG4J2-2478):
AbstractStringLayoutStringEncodingBenchmark returns the computed variables on each benchmark to avoid DCE. Thanks to Diego Elias Costa.
* [LOG4J2-2134](https://issues.apache.org/jira/browse/LOG4J2-2134):
StackOverflowError at AwaitCompletionReliabilityStrategy. Thanks to David del Amo Mateos, Gary Gregory.
* [LOG4J2-2481](https://issues.apache.org/jira/browse/LOG4J2-2481):
Avoid NullPointerExceptions in org.apache.logging.log4j.core.config.AbstractConfiguration for null arguments.
* [LOG4J2-2457](https://issues.apache.org/jira/browse/LOG4J2-2457):
RollingRandomAccessFileManager ignores new file patterns from programmatic reconfiguration. Thanks to Heiko Schwanke, Gary Gregory.
* [LOG4J2-2482](https://issues.apache.org/jira/browse/LOG4J2-2482):
BasicContextSelector cannot be used in a OSGI application. Thanks to Rob Gansevles.
* [LOG4J2-2476](https://issues.apache.org/jira/browse/LOG4J2-2476):
org.apache.log4j.SimpleLayout and ConsoleAppender missing in log4j-1.2-api. Thanks to Al Bundy.
* [LOG4J2-2497](https://issues.apache.org/jira/browse/LOG4J2-2497):
JmsAppender reconnectIntervalMillis cannot be set from a configuration file.
* [LOG4J2-2499](https://issues.apache.org/jira/browse/LOG4J2-2499):
JMS Appender may throw a NullPointerException when JMS is not up while the Appender is starting.
* [LOG4J2-2508](https://issues.apache.org/jira/browse/LOG4J2-2508):
JDBC Appender fails when using both parameter, source, and literal ColumnMapping elements.
* [LOG4J2-2527](https://issues.apache.org/jira/browse/LOG4J2-2527):
Prevent ConcurrentModificationException while iterating over ListAppender events.
* [LOG4J2-2522](https://issues.apache.org/jira/browse/LOG4J2-2522):
Fix regression using MapMessageLookup.lookup with MapMessages that do not implement StringMapMessage. Thanks to Adam Lesiak.
* [LOG4J2-2530](https://issues.apache.org/jira/browse/LOG4J2-2530):
Generalize checks using MapMessage implementations with do not extend StringMapMessage.
Introduce new JAVA_UNQUOTED MapMessage format type based on the JAVA formatting, but without
quoted values. Thanks to Travis Spencer.
* [LOG4J2-2533](https://issues.apache.org/jira/browse/LOG4J2-2533):
Fix a regression introduced by LOG4J2-2301 in 2.11.1 allowing allocation to occur in AsyncLoggerConfig. Thanks to Michail Prusakov.
### Changes
* [LOG4J2-1721](https://issues.apache.org/jira/browse/LOG4J2-1721):
Allow composite configuration for context parameter. Thanks to Phokham Nonava.
* [LOG4J2-2302](https://issues.apache.org/jira/browse/LOG4J2-2302):
Status logger should show the Log4j name and version when initializing itself.
* [LOG4J2-2304](https://issues.apache.org/jira/browse/LOG4J2-2304):
Log4j2 2.8.2 JMX unregister NullPointerException. Thanks to wumengsheng.
* [LOG4J2-2311](https://issues.apache.org/jira/browse/LOG4J2-2311):
Update Jackson from 2.9.4 to 2.9.5.
* [LOG4J2-2313](https://issues.apache.org/jira/browse/LOG4J2-2313):
Update LMAX Disruptor from 3.3.7 to 3.4.2.
* [LOG4J2-548](https://issues.apache.org/jira/browse/LOG4J2-548):
Log4j 2.0 ERROR "Could not search jar" with JBoss EAP 6.2. Thanks to Shehata, Paresh Varke, Eric Victorson, Martin Laforet.
* [LOG4J2-2328](https://issues.apache.org/jira/browse/LOG4J2-2328):
Update JAnsi from 1.17 to 1.17.1.
* [LOG4J2-2351](https://issues.apache.org/jira/browse/LOG4J2-2351):
Added AbstractLogEvent.getMutableInstant to allow the MutableInstant instance to be modified by classes extending AbstractLogEvent.
* [LOG4J2-2357](https://issues.apache.org/jira/browse/LOG4J2-2357):
Update Jackson from 2.9.5 to 2.9.6.
* [LOG4J2-2358](https://issues.apache.org/jira/browse/LOG4J2-2358):
Update Kafka client from 1.0.0 to 1.1.0.
* [LOG4J2-2384](https://issues.apache.org/jira/browse/LOG4J2-2384):
Update Kafka client from 1.1.0 to 1.1.1.
* [LOG4J2-2385](https://issues.apache.org/jira/browse/LOG4J2-2385):
Update Groovy from 2.4.13 to 2.5.1.
* [LOG4J2-2386](https://issues.apache.org/jira/browse/LOG4J2-2386):
Update optional Apache Commons DBCP from 2.2.0 to 2.4.0.
* [LOG4J2-1576](https://issues.apache.org/jira/browse/LOG4J2-1576):
Switch from CLIRR to RevAPI for detecting API changes.
* [LOG4J2-2391](https://issues.apache.org/jira/browse/LOG4J2-2391):
Improve exception logging performance. ThrowableProxy construction uses a faster
method to discover the current stack trace. ThrowablePatternConverter and
ExtendedThrowablePatternConverter default configurations no longer allocate
an additional buffer for stack trace contents.
* [LOG4J2-2447](https://issues.apache.org/jira/browse/LOG4J2-2447):
Let the NullAppender default its name to "null".
* [LOG4J2-2468](https://issues.apache.org/jira/browse/LOG4J2-2468):
Update Jackson from 2.9.6 to 2.9.7.
* [LOG4J2-2469](https://issues.apache.org/jira/browse/LOG4J2-2469):
Update Apache Commons Compress from 1.17 to 1.18.
* [LOG4J2-2470](https://issues.apache.org/jira/browse/LOG4J2-2470):
Update Apache Commons CSV from 1.5 to 1.6.
* [LOG4J2-2471](https://issues.apache.org/jira/browse/LOG4J2-2471):
Update javax.mail from 1.6.1 to 1.6.2.
* [LOG4J2-2472](https://issues.apache.org/jira/browse/LOG4J2-2472):
Update mongo-java-driver 3 from 3.8.0 to 3.8.2.
* [LOG4J2-2489](https://issues.apache.org/jira/browse/LOG4J2-2489):
JDBC Appender should release parameter resources ASAP.
* [LOG4J2-2491](https://issues.apache.org/jira/browse/LOG4J2-2491):
Allow all Appenders to optionally carry a Property array.
* [LOG4J2-2405](https://issues.apache.org/jira/browse/LOG4J2-2405):
Better handling of %highlight pattern when using jul-bridge. Thanks to Marco Herrn.
* [LOG4J2-2503](https://issues.apache.org/jira/browse/LOG4J2-2503):
Update MongoDB driver from 3.8.2 to 3.9.0 for log4j-mongodb3 module.
---
Apache Log4j 2.11.1 requires a minimum of Java 7 to build and run. Log4j 2.3 was the
Apache Log4j 2.11.2 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
......
apache-log4j2 (2.11.1-3) UNRELEASED; urgency=medium
apache-log4j2 (2.11.2-1) unstable; urgency=medium
* Team upload.
[ tony mancill ]
* Revert "Drop support for mongodb (Debian: #919095)"
-- tony mancill <tmancill@debian.org> Sun, 13 Jan 2019 08:01:26 -0800
[ Emmanuel Bourg ]
* New upstream release
- Refreshed the patches
- Updated the Maven rules
* Sort the entries in the plugin cache (Log4j2Plugins.dat) to make
the build reproducible
* Standards-Version updated to 4.4.0
-- Emmanuel Bourg <ebourg@apache.org> Tue, 10 Sep 2019 10:32:34 +0200
apache-log4j2 (2.11.1-2) unstable; urgency=medium
......
......@@ -45,7 +45,7 @@ Build-Depends:
libslf4j-java,
libwoodstox-java,
maven-debian-helper (>= 1.5)
Standards-Version: 4.3.0
Standards-Version: 4.4.0
Vcs-Git: https://salsa.debian.org/java-team/apache-log4j2.git
Vcs-Browser: https://salsa.debian.org/java-team/apache-log4j2
Homepage: http://logging.apache.org/log4j/2.x/
......
......@@ -50,6 +50,7 @@ org.hdrhistogram HdrHistogram * * * *
org.hsqldb hsqldb * * * *
org.mockejb mockejb * * * *
org.mockito mockito-core * * * *
org.revapi revapi-maven-plugin * * * *
org.slf4j slf4j-ext * * * *
org.springframework spring-test * * * *
org.tukaani xz * * * *
......
......@@ -3,7 +3,7 @@ Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -393,6 +393,7 @@
@@ -394,6 +394,7 @@
<configuration>
<excludes>
<exclude>module-info.java</exclude>
......@@ -11,7 +11,7 @@ Forwarded: not-needed
</excludes>
<proc>none</proc>
</configuration>
@@ -407,6 +408,7 @@
@@ -408,6 +409,7 @@
<configuration>
<excludes>
<exclude>module-info.java</exclude>
......@@ -19,7 +19,7 @@ Forwarded: not-needed
</excludes>
<proc>only</proc>
</configuration>
@@ -501,6 +503,14 @@
@@ -500,6 +502,14 @@
</instructions>
</configuration>
</plugin>
......@@ -36,10 +36,10 @@ Forwarded: not-needed
<reporting>
--- a/pom.xml
+++ b/pom.xml
@@ -898,6 +898,7 @@
@@ -909,6 +909,7 @@
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo,
and the Apache Log4j logo are trademarks of The Apache Software Foundation.</p>]]></bottom>
<additionalparam>${javadoc.opts}</additionalparam>
<doclint>none</doclint>
+ <excludePackageNames>*.kafka.*</excludePackageNames>
</configuration>
</plugin>
......
......@@ -3,7 +3,7 @@ Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/tools/picocli/CommandLine.java
@@ -2814,7 +2814,7 @@
@@ -2815,7 +2815,7 @@
*/
public static class Help {
/** Constant String holding the default program name: {@value} */
......
Description: Sort the entries in the plugin cache (Log4j2Plugins.dat) to make the build reproducible
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: no
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginCache.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/plugins/processor/PluginCache.java
@@ -25,7 +25,7 @@
import java.io.OutputStream;
import java.net.URL;
import java.util.Enumeration;
-import java.util.LinkedHashMap;
+import java.util.TreeMap;
import java.util.Map;
/**
@@ -33,7 +33,7 @@
*/
public class PluginCache {
private final Map<String, Map<String, PluginEntry>> categories =
- new LinkedHashMap<>();
+ new TreeMap<>();
/**
* Returns all categories of plugins in this cache.
@@ -54,7 +54,7 @@
public Map<String, PluginEntry> getCategory(final String category) {
final String key = category.toLowerCase();
if (!categories.containsKey(key)) {
- categories.put(key, new LinkedHashMap<String, PluginEntry>());
+ categories.put(key, new TreeMap<String, PluginEntry>());
}
return categories.get(key);
}
01-disable-kafka-appender.patch
03-mongodb-compatibility.patch
05-fix-javadoc-errors.patch
06-reproducible-plugin-cache.patch
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.11.1</version>
<version>2.11.2</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-1.2-api</artifactId>
......
......@@ -56,7 +56,7 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
}
@Override
public void addFilter(Filter newFilter) {
public void addFilter(final Filter newFilter) {
if(headFilter == null) {
headFilter = tailFilter = newFilter;
} else {
......@@ -104,7 +104,7 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
return threshold;
}
public boolean isAsSevereAsThreshold(Priority priority) {
public boolean isAsSevereAsThreshold(final Priority priority) {
return ((threshold == null) || priority.isGreaterOrEqual(threshold));
}
......@@ -113,7 +113,7 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
* @param event The LoggingEvent.
*/
@Override
public void doAppend(LoggingEvent event) {
public void doAppend(final LoggingEvent event) {
}
/**
......@@ -122,54 +122,54 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
* @since 0.9.0
*/
@Override
public synchronized void setErrorHandler(ErrorHandler eh) {
public synchronized void setErrorHandler(final ErrorHandler eh) {
if (eh != null) {
this.errorHandler = eh;
}
}
@Override
public void setLayout(Layout layout) {
public void setLayout(final Layout layout) {
this.layout = layout;
}
@Override
public void setName(String name) {
public void setName(final String name) {
this.name = name;
}
public void setThreshold(Priority threshold) {
public void setThreshold(final Priority threshold) {
this.threshold = threshold;
}
public static class NoOpErrorHandler implements ErrorHandler {
@Override
public void setLogger(Logger logger) {
public void setLogger(final Logger logger) {
}
@Override
public void error(String message, Exception e, int errorCode) {
public void error(final String message, final Exception e, final int errorCode) {
}
@Override
public void error(String message) {
public void error(final String message) {
}
@Override
public void error(String message, Exception e, int errorCode, LoggingEvent event) {
public void error(final String message, final Exception e, final int errorCode, final LoggingEvent event) {
}
@Override
public void setAppender(Appender appender) {
public void setAppender(final Appender appender) {
}
@Override
public void setBackupAppender(Appender appender) {
public void setBackupAppender(final Appender appender) {
}
}
......
/*
* 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
*
* http://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.
*/
package org.apache.log4j;
import org.apache.log4j.spi.LoggingEvent;
/**
* Console-appender.
*/
public class ConsoleAppender extends AppenderSkeleton
{
/**
* {@inheritDoc}
*/
@Override
public void close()
{
}
/**
* {@inheritDoc}
*/
@Override
public boolean requiresLayout()
{
return false;
}
/**
* {@inheritDoc}
*/
@Override
protected void append(final LoggingEvent theEvent)
{
}
}
......@@ -24,6 +24,8 @@ import org.apache.logging.log4j.util.Strings;
*/
public abstract class Layout {
public final static String LINE_SEP = Strings.LINE_SEPARATOR;
/** Note that the line.separator property can be looked up even by applets. */
public static final int LINE_SEP_LEN = Strings.LINE_SEPARATOR.length();
......
/*
* 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
*
* http://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.
*/
package org.apache.log4j;
import org.apache.log4j.spi.LoggingEvent;
import org.apache.logging.log4j.util.Strings;
/**
* Simple-layout.
*/
public class SimpleLayout extends Layout
{
/**
* {@inheritDoc}
*/
@Override
public String format(final LoggingEvent theEvent)
{
return Strings.EMPTY;
}
/**
* {@inheritDoc}
*/
@Override
public boolean ignoresThrowable()
{
return true;
}
}
......@@ -26,6 +26,7 @@ import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.LoggerContext;
import org.apache.logging.log4j.core.appender.AbstractAppender;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
import org.apache.logging.log4j.core.config.Property;
import org.apache.logging.log4j.core.layout.PatternLayout;
import org.apache.logging.log4j.test.appender.ListAppender;
import org.junit.After;
......@@ -507,7 +508,7 @@ public class LoggerTest {
int counter;
CountingAppender() {
super("Counter", null, null);
super("Counter", null, null, true, Property.EMPTY_ARRAY);
counter = 0;
}
......
......@@ -174,7 +174,7 @@ public class Log4j1ConfigurationFactoryTest {
} finally {
try {
Files.deleteIfExists(tempFilePath);
} catch (FileSystemException e) {
} catch (final FileSystemException e) {
e.printStackTrace();
}
}
......
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.11.1</version>
<version>2.11.2</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api-java9</artifactId>
......@@ -109,8 +109,6 @@
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
<forkCount>2C</forkCount>
<reuseForks>true</reuseForks>
<includes>
<include>**/Test*.java</include>
<include>**/*Test.java</include>
......
......@@ -35,6 +35,7 @@
<exclude>**/Dummy.class</exclude>
<exclude>**/spi/Provider.class</exclude>
<exclude>**/util/PropertySource.class</exclude>
<exclude>**/util/PrivateSecurityManagerStackTraceUtil.class</exclude>
<exclude>**/message/ThreadDumpMessage.class</exclude>
<exclude>**/message/ThreadDumpMessage$ThreadInfoFactory.class</exclude>
</excludes>
......
/*
* 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
*
* http://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.
*/
package org.apache.logging.log4j.util;
import java.util.Stack;
/**
* This is a dummy class and is only here to allow this module to compile. It will not
* be copied into the log4j-api module.
*/
final class PrivateSecurityManagerStackTraceUtil {
static boolean isEnabled() {
return false;
}
static Stack<Class<?>> getCurrentStackTrace() {
return null;
}
}
......@@ -61,6 +61,10 @@ public class StackLocator {
}
public Stack<Class<?>> getCurrentStackTrace() {
// benchmarks show that using the SecurityManager is much faster than looping through getCallerClass(int)
if (PrivateSecurityManagerStackTraceUtil.isEnabled()) {
return PrivateSecurityManagerStackTraceUtil.getCurrentStackTrace();
}
Stack<Class<?>> stack = new Stack<Class<?>>();
List<Class<?>> classes = walker.walk(s -> s.map(f -> f.getDeclaringClass()).collect(Collectors.toList()));
stack.addAll(classes);
......
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.11.1</version>
<version>2.11.2</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api</artifactId>
......@@ -148,14 +148,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>2C</forkCount>
<reuseForks>true</reuseForks>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
......@@ -230,9 +222,6 @@
<Export-Package>org.apache.logging.log4j.*</Export-Package>
<Import-Package>
sun.reflect;resolution:=optional,
org.apache.logging.log4j.core.osgi;resolution:=optional,
org.apache.logging.log4j.core.util;resolution:=optional,
org.apache.logging.log4j.core.async;resolution:=optional,
*
</Import-Package>
<Bundle-Activator>org.apache.logging.log4j.util.Activator</Bundle-Activator>
......@@ -249,11 +238,6 @@
</build>
<reporting>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>clirr-maven-plugin</artifactId>
<version>${clirr.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-changes-plugin</artifactId>
......@@ -293,6 +277,7 @@
and the Apache Log4j logo are trademarks of The Apache Software Foundation.</p>]]></bottom>
<!-- module link generation is completely broken in the javadoc plugin for a multi-module non-aggregating
project -->
<doclint>none</doclint>
<detectOfflineLinks>false</detectOfflineLinks>
<linksource>true</linksource>
<links>
......