Skip to content
Commits on Source (15)
# Apache Log4j 2.10.0 Release Notes
The Apache Log4j 2 team is pleased to announce the Log4j 2.10.0 release!
<!---
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.
-->
# Apache Log4j 2.11.1 Release Notes
The Apache Log4j 2 team is pleased to announce the Log4j 2.11.1 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
......@@ -9,10 +25,11 @@ 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. Some of the new features include support
for the Java 9 module system, support for the new SLF4j 1.8 binding mechanism, simplification of the Log4j
property naming scheme, and native support of Jetty's logger. Log4j API is now a fully compliant module
while the other Log4j jars are named automatic modules.
This release contains new features, 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.
As of Log4j 2.9.0, the Log4j API was modified to use java.util.ServiceLoader to locate Log4j implementations,
although the former binding mechanism is still supported. The Log4j API jar is now a multi-release jar
......@@ -47,112 +64,126 @@ 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.
The Log4j 2.10.0 API, as well as many core components, maintains binary compatibility with previous releases.
The Log4j 2.11.1 API, as well as many core components, maintains binary compatibility with previous releases.
## GA Release 2.10.0
## GA Release 2.11.1
Changes in this version include:
### New Features
* [LOG4J2-2120](https://issues.apache.org/jira/browse/LOG4J2-2120):
Properly escape newlines and other control characters in JSON. Thanks to Carter Douglas Kozak.
* [LOG4J2-2109](https://issues.apache.org/jira/browse/LOG4J2-2109):
Add property to disable message pattern converter lookups. Thanks to Carter Douglas Kozak.
* [LOG4J2-2112](https://issues.apache.org/jira/browse/LOG4J2-2112):
MapMessage should use deep toString for values. Thanks to Carter Douglas Kozak.
* [LOG4J2-2103](https://issues.apache.org/jira/browse/LOG4J2-2103):
XML encoding for PatternLayout.
* [LOG4J2-2114](https://issues.apache.org/jira/browse/LOG4J2-2114):
Provide a native Log4j 2 implementation of Eclipse Jetty's org.eclipse.jetty.util.log.Logger.
* [LOG4J2-1203](https://issues.apache.org/jira/browse/LOG4J2-1203):
Allow filtering of line breaks in layout pattern. Thanks to Robert Turner.
* [LOG4J2-2098](https://issues.apache.org/jira/browse/LOG4J2-2098):
Add a noop AppenderSkeleton for applications still using Log4j 1.x.
* [LOG4J2-2062](https://issues.apache.org/jira/browse/LOG4J2-2062):
Add possibility of sending the key of a message to Kafka using KafkaAppender. Thanks to Jorge Sanchez.
* [LOG4J2-2056](https://issues.apache.org/jira/browse/LOG4J2-2056):
Modularize Log4j-api and make most other log4j jars automatic modules.
* [LOG4J2-1431](https://issues.apache.org/jira/browse/LOG4J2-1431):
Simplify log4j system property naming scheme.
* [LOG4J2-1809](https://issues.apache.org/jira/browse/LOG4J2-1809):
Add global configuration environment SPI.
* [LOG4J2-1694](https://issues.apache.org/jira/browse/LOG4J2-1694):
Add fields with fixed values to JSON/XML/YAML layouts. Thanks to Michal Dvořák.
* [LOG4J2-2054](https://issues.apache.org/jira/browse/LOG4J2-2054):
Provide ways to configure SSL that avoid plain-text passwords in the log4j configuration. The configuration may
now specify a system environment variable that holds the password, or the path to a file that holds the password.
* [LOG4J2-2071](https://issues.apache.org/jira/browse/LOG4J2-2071):
Add org.apache.logging.log4j.core.config.composite.CompositeConfiguration#toString(). Thanks to Carter Kozak.
### Fixed Bugs
* [LOG4J2-2107](https://issues.apache.org/jira/browse/LOG4J2-2107):
MapMessage supports both StringBuilderFormattable and MultiformatMessage. Thanks to Carter Douglas Kozak.
* [LOG4J2-2102](https://issues.apache.org/jira/browse/LOG4J2-2102):
MapMessage JSON encoding will escape keys and values. Thanks to Carter Douglas Kozak.
* [LOG4J2-2101](https://issues.apache.org/jira/browse/LOG4J2-2101):
Non-string value in MapMessage caused ClassCastException. Thanks to Carter Douglas Kozak.
* [LOG4J2-2091](https://issues.apache.org/jira/browse/LOG4J2-2091):
Log4j respects the configured "log4j2.is.webapp" property Thanks to Carter Douglas Kozak.
* [LOG4J2-2100](https://issues.apache.org/jira/browse/LOG4J2-2100):
LevelMixIn class for Jackson is coded incorrectly
* [LOG4J2-2087](https://issues.apache.org/jira/browse/LOG4J2-2087):
Jansi now needs to be enabled explicitly (by setting system property `log4j.skipJansi` to `false`). To avoid causing problems for web applications, Log4j will no longer automatically try to load Jansi without explicit configuration. Thanks to Andy Gumbrecht.
* [LOG4J2-2060](https://issues.apache.org/jira/browse/LOG4J2-2060):
AbstractDatabaseManager should make a copy of LogEvents before holding references to them: AsyncLogger log events are mutable.
* [LOG4J2-2055](https://issues.apache.org/jira/browse/LOG4J2-2055):
If Log4j is used as the Tomcat logging implementation startup might fail if an application also uses Log4j.
* [LOG4J2-2031](https://issues.apache.org/jira/browse/LOG4J2-2031):
Until this change, messages appeared out of order in log file any time when the async logging queue was full.
With this change, messages are only logged out of order to prevent deadlock when Log4j2 detects recursive
logging while the queue is full.
* [LOG4J2-2053](https://issues.apache.org/jira/browse/LOG4J2-2053):
Exception java.nio.charset.UnsupportedCharsetException: cp65001 in 2.9.0.
* [LOG4J2-1216](https://issues.apache.org/jira/browse/LOG4J2-1216):
Nested pattern layout options broken. Thanks to Thies Wellpott, Barna Zsombor Klara, GFriedrich.
* [LOG4J2-2070](https://issues.apache.org/jira/browse/LOG4J2-2070):
Log4j1XmlLayout does not provide the entire stack trace, it is missing the caused by information. Thanks to Doug Hughes.
* [LOG4J2-2036](https://issues.apache.org/jira/browse/LOG4J2-2036):
CompositeConfiguration supports Reconfiguration. PR #115. Thanks to Robert Haycock.
* [LOG4J2-2073](https://issues.apache.org/jira/browse/LOG4J2-2073):
Log4j-config.xsd should make AppenderRef optional for each Logger element. Thanks to Patrick Lucas.
* [LOG4J2-2074](https://issues.apache.org/jira/browse/LOG4J2-2074):
The console appender should say why it cannot load JAnsi.
* [LOG4J2-2085](https://issues.apache.org/jira/browse/LOG4J2-2085):
Wrong Apache Commons CSV version referenced in the Javadoc of CsvParameterLayout. Thanks to István Neuwirth.
* [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.
### Changes
* [LOG4J2-2076](https://issues.apache.org/jira/browse/LOG4J2-2076):
Split up log4j-nosql into one module per appender.
* [LOG4J2-2088](https://issues.apache.org/jira/browse/LOG4J2-2088):
Upgrade picocli to 2.0.3 from 0.9.8.
* [LOG4J2-2025](https://issues.apache.org/jira/browse/LOG4J2-2025):
Provide support for overriding the Tomcat Log class in Tomcat 8.5+.
* [LOG4J2-2057](https://issues.apache.org/jira/browse/LOG4J2-2057):
Support new SLF4J binding mechanism introduced in SLF4J 1.8.
* [LOG4J2-2052](https://issues.apache.org/jira/browse/LOG4J2-2052):
Disable thread name caching by default when running on Java 8u102 or later.
* [LOG4J2-1896](https://issues.apache.org/jira/browse/LOG4J2-1896):
Update classes in org.apache.logging.log4j.core.net.ssl in APIs from String to a PasswordProvider producing
char[] for passwords.
* [LOG4J2-2078](https://issues.apache.org/jira/browse/LOG4J2-2078):
Update LMAX disruptor from 3.3.6 to 3.3.7.
* [LOG4J2-2081](https://issues.apache.org/jira/browse/LOG4J2-2081):
Update Apache Commons Compress from 1.14 to 1.15.
* [LOG4J2-2089](https://issues.apache.org/jira/browse/LOG4J2-2089):
[TagLib] Update servlet-api provided dependency from 2.5 to 3.0.1.
* [LOG4J2-2096](https://issues.apache.org/jira/browse/LOG4J2-2096):
Update Apache Kafka kafka-clients from 0.11.0.1 to 1.0.0.
* [LOG4J2-2077](https://issues.apache.org/jira/browse/LOG4J2-2077):
Update from Jackson 2.9.1 to 2.9.2.
* [LOG4J2-2117](https://issues.apache.org/jira/browse/LOG4J2-2117):
Jackson dependencies for 2.9.2 incorrectly bring in jackson-annotations 2.9.0 instead of 2.9.2.
* [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.
---
Apache Log4j 2.10.0 requires a minimum of Java 7 to build and run. Log4j 2.3 was the
Apache Log4j 2.11.1 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-1) unstable; urgency=medium
* Team upload.
* New upstream release
- Refreshed the patches
- Build the new log4j-core-java9 module
- Build the mongodb3 module and ignore the mongodb2 one
- Ignore the new log4j-jdbc-dbcp2, log4j-jpa and log4j-slf4j18-impl modules
* Worked around a javadoc bug in Java 10 causing an IllegalArgumentException
(Closes: #905139)
* Standards-Version updated to 4.1.5
* Use salsa.debian.org Vcs-* URLs
-- Emmanuel Bourg <ebourg@apache.org> Tue, 31 Jul 2018 17:12:58 +0200
apache-log4j2 (2.10.0-2) unstable; urgency=medium
* Team upload.
......
......@@ -45,9 +45,9 @@ Build-Depends:
libslf4j-java,
libwoodstox-java,
maven-debian-helper (>= 1.5)
Standards-Version: 4.1.4
Vcs-Git: https://anonscm.debian.org/git/pkg-java/apache-log4j2.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/apache-log4j2.git
Standards-Version: 4.1.5
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/
Package: liblog4j2-java
......
......@@ -32,18 +32,23 @@ log4j-appserver/pom.xml --ignore
log4j-cassandra/pom.xml --ignore
log4j-core/pom.xml --has-package-version --java-lib
log4j-core-its/pom.xml --ignore
log4j-core-java9/pom.xml --has-package-version --java-lib
log4j-couchdb/pom.xml --has-package-version --java-lib
log4j-jdbc-dbcp2/pom.xml --ignore
log4j-1.2-api/pom.xml --has-package-version --java-lib
log4j-slf4j-impl/pom.xml --ignore
log4j-slf4j18-impl/pom.xml --ignore
log4j-to-slf4j/pom.xml --has-package-version --java-lib
log4j-jcl/pom.xml --has-package-version --java-lib
log4j-jpa/pom.xml --ignore
log4j-flume-ng/pom.xml --ignore
log4j-taglib/pom.xml --ignore
log4j-jmx-gui/pom.xml --ignore
log4j-samples/pom.xml --ignore
log4j-osgi/pom.xml --ignore
log4j-bom/pom.xml --no-parent --has-package-version
log4j-mongodb/pom.xml --has-package-version --java-lib
log4j-mongodb2/pom.xml --ignore
log4j-mongodb3/pom.xml --has-package-version --java-lib
log4j-web/pom.xml --has-package-version --java-lib
log4j-jul/pom.xml --has-package-version --java-lib
log4j-perf/pom.xml --ignore
......
......@@ -10,6 +10,7 @@ org.apache.logging.log4j.osgi log4j-osgi pom * * *
org.apache.logging.log4j.samples log4j-samples pom * * *
ch.qos.logback logback-classic * * * *
ch.qos.logback logback-core * * * *
de.flapdoodle.embed de.flapdoodle.embed.mongo * * * *
com.datastax.cassandra cassandra-driver-core * * * *
com.github.tomakehurst wiremock * * * *
com.google.code.java-allocation-instrumenter java-allocation-instrumenter * * * *
......@@ -36,6 +37,7 @@ org.apache.maven.plugins maven-toolchains-plugin * * * *
org.apache.maven.wagon wagon-ssh * * * *
org.apache.rat apache-rat-plugin * * * *
org.apache.velocity velocity * * * *
org.codehaus.groovy groovy-dateutil * * * *
org.codehaus.mojo clirr-maven-plugin * * * *
org.codehaus.mojo cobertura-maven-plugin * * * *
org.codehaus.mojo findbugs-maven-plugin * * * *
......
......@@ -24,3 +24,4 @@ s/org.apache-extras.beanshell/org.beanshell/ bsh * s/.*/debian/ * *
s/com.fasterxml.woodstox/org.codehaus.woodstox/ s/woodstox-core/woodstox-core-lgpl/ * s/.*/debian/ * *
com.conversantmedia disruptor * s/.*/debian/ s/.*// *
org.apache.logging.log4j log4j-api-java9 zip * * *
org.apache.logging.log4j log4j-core-java9 zip * * *
......@@ -3,7 +3,7 @@ Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/log4j-core/pom.xml
+++ b/log4j-core/pom.xml
@@ -351,6 +351,7 @@
@@ -393,6 +393,7 @@
<configuration>
<excludes>
<exclude>module-info.java</exclude>
......@@ -11,7 +11,7 @@ Forwarded: not-needed
</excludes>
<proc>none</proc>
</configuration>
@@ -365,6 +366,7 @@
@@ -407,6 +408,7 @@
<configuration>
<excludes>
<exclude>module-info.java</exclude>
......@@ -19,7 +19,7 @@ Forwarded: not-needed
</excludes>
<proc>only</proc>
</configuration>
@@ -435,6 +437,14 @@
@@ -501,6 +503,14 @@
</instructions>
</configuration>
</plugin>
......@@ -36,7 +36,7 @@ Forwarded: not-needed
<reporting>
--- a/pom.xml
+++ b/pom.xml
@@ -856,6 +856,7 @@
@@ -898,6 +898,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>
......
Description: Fixes the compatibility with the version of the MongoDB driver in Debian
Author: Emmanuel Bourg <ebourg@apache.org>
Forwarded: not-needed
--- a/log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb/MongoDbProvider.java
+++ b/log4j-mongodb/src/main/java/org/apache/logging/log4j/mongodb/MongoDbProvider.java
@@ -290,7 +290,7 @@
--- a/log4j-mongodb3/src/main/java/org/apache/logging/log4j/mongodb3/MongoDbProvider.java
+++ b/log4j-mongodb3/src/main/java/org/apache/logging/log4j/mongodb3/MongoDbProvider.java
@@ -172,7 +172,7 @@
if (Strings.isNotEmpty(userName) && Strings.isNotEmpty(password)) {
description += ", username=" + userName + ", passwordHash="
+ NameUtil.md5(password + MongoDbProvider.class.getName());
- credentials.add(MongoCredential.createCredential(userName, databaseName, password.toCharArray()));
+ credentials.add(MongoCredential.createMongoCRCredential(userName, databaseName, password.toCharArray()));
- mongoCredential = MongoCredential.createCredential(userName, databaseName, password.toCharArray());
+ mongoCredential = MongoCredential.createMongoCRCredential(userName, databaseName, password.toCharArray());
}
try {
final int portInt = TypeConverters.convert(port, int.class, DEFAULT_PORT);
Description: Workaround for a javadoc bug in Java 10 triggering an IllegalArgumentException
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 @@
*/
public static class Help {
/** Constant String holding the default program name: {@value} */
- protected static final String DEFAULT_COMMAND_NAME = "<main class>";
+ protected static final String DEFAULT_COMMAND_NAME = new String("<main class>");
/** Constant String holding the default string that separates options from option parameters: {@value} */
protected static final String DEFAULT_SEPARATOR = "=";
01-disable-kafka-appender.patch
03-mongodb-compatibility.patch
05-fix-javadoc-errors.patch
......@@ -34,7 +34,7 @@
<vendor>sun</vendor>
</provides>
<configuration>
<jdkHome>/home/jenkins/tools/java/latest1.7</jdkHome>
<jdkHome>/home/jenkins/tools/java/latest1.8</jdkHome>
</configuration>
</toolchain>
<toolchain>
......
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.10.0</version>
<version>2.11.1</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-1.2-api</artifactId>
......
......@@ -51,9 +51,11 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
super();
}
@Override
public void activateOptions() {
}
@Override
public void addFilter(Filter newFilter) {
if(headFilter == null) {
headFilter = tailFilter = newFilter;
......@@ -65,17 +67,21 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
protected abstract void append(LoggingEvent event);
@Override
public void clearFilters() {
headFilter = tailFilter = null;
}
@Override
public void finalize() {
}
@Override
public ErrorHandler getErrorHandler() {
return this.errorHandler;
}
@Override
public Filter getFilter() {
return headFilter;
}
......@@ -84,10 +90,12 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
return headFilter;
}
@Override
public Layout getLayout() {
return layout;
}
@Override
public final String getName() {
return this.name;
}
......@@ -104,6 +112,7 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
* This method is never going to be called in Log4j 2 so there isn't much point in having any code in it.
* @param event The LoggingEvent.
*/
@Override
public void doAppend(LoggingEvent event) {
}
......@@ -112,16 +121,19 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
*
* @since 0.9.0
*/
@Override
public synchronized void setErrorHandler(ErrorHandler eh) {
if (eh != null) {
this.errorHandler = eh;
}
}
@Override
public void setLayout(Layout layout) {
this.layout = layout;
}
@Override
public void setName(String name) {
this.name = name;
}
......
......@@ -39,6 +39,7 @@ public class LogWithMDCTest {
public void testMDC() throws Exception {
MDC.put("Key1", "John");
MDC.put("Key2", "Smith");
try {
final Logger logger = Logger.getLogger("org.apache.test.logging");
logger.debug("This is a test");
final ListAppender listApp = (ListAppender) CTX.getAppender("List");
......@@ -48,5 +49,9 @@ public class LogWithMDCTest {
assertTrue(msgs.size() == 1);
assertTrue("Key1 is missing", msgs.get(0).contains("Key1=John"));
assertTrue("Key2 is missing", msgs.get(0).contains("Key2=Smith"));
} finally {
MDC.remove("Key1");
MDC.remove("Key2");
}
}
}
......@@ -40,6 +40,7 @@ public class LogWithRouteTest {
public void testMDC() throws Exception {
MDC.put("Type", "Service");
MDC.put("Name", "John Smith");
try {
final Logger logger = Logger.getLogger("org.apache.test.logging");
logger.debug("This is a test");
final ListAppender listApp = (ListAppender) CTX.getAppender("List");
......@@ -49,5 +50,9 @@ public class LogWithRouteTest {
assertTrue(msgs.size() == 1);
assertTrue("Type is missing", msgs.get(0).contains("Type=Service"));
assertTrue("Name is missing", msgs.get(0).contains("Name=John Smith"));
} finally {
MDC.remove("Type");
MDC.remove("Name");
}
}
}
......@@ -24,6 +24,7 @@ import static org.junit.Assert.assertTrue;
import java.io.File;
import java.net.URISyntaxException;
import java.net.URL;
import java.nio.file.FileSystemException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.concurrent.TimeUnit;
......@@ -167,10 +168,15 @@ public class Log4j1ConfigurationFactoryTest {
try {
final Configuration configuration = getConfiguration("config-1.2/log4j-system-properties-1.properties");
final RollingFileAppender appender = configuration.getAppender("RFA");
appender.stop(10, TimeUnit.SECONDS);
System.out.println("expected: " + tempFileName + " Actual: " + appender.getFileName());
assertEquals(tempFileName, appender.getFileName());
} finally {
try {
Files.deleteIfExists(tempFilePath);
} catch (FileSystemException e) {
e.printStackTrace();
}
}
}
......
......@@ -16,18 +16,22 @@
*/
package org.apache.log4j.layout;
import static org.junit.Assert.assertEquals;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.impl.ContextDataFactory;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.junit.ThreadContextRule;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.util.StringMap;
import org.junit.Rule;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
public class Log4j1XmlLayoutTest {
@Rule
public ThreadContextRule threadContextRule = new ThreadContextRule();
@Test
public void testWithoutThrown() {
final Log4j1XmlLayout layout = Log4j1XmlLayout.createLayout(false, true);
......@@ -53,9 +57,9 @@ public class Log4j1XmlLayoutTest {
public void testWithPropertiesAndLocationInfo() {
final Log4j1XmlLayout layout = Log4j1XmlLayout.createLayout(true, true);
final Map<String, String> contextMap = new HashMap<>(2);
contextMap.put("key1", "value1");
contextMap.put("key2", "value2");
final StringMap contextMap = ContextDataFactory.createContextData(2);
contextMap.putValue("key1", "value1");
contextMap.putValue("key2", "value2");
final Log4jLogEvent event = Log4jLogEvent.newBuilder()
.setLoggerName("a.B")
.setLevel(Level.INFO)
......@@ -63,7 +67,7 @@ public class Log4j1XmlLayoutTest {
.setTimeMillis(System.currentTimeMillis() + 17)
.setIncludeLocation(true)
.setSource(new StackTraceElement("pack.MyClass", "myMethod", "MyClass.java", 17))
.setContextMap(contextMap)
.setContextData(contextMap)
.build();
final String result = layout.toSerializable(event);
......
......@@ -16,58 +16,57 @@
*/
package org.apache.log4j.pattern;
import static org.junit.Assert.assertEquals;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.core.LogEvent;
import org.apache.logging.log4j.core.impl.ContextDataFactory;
import org.apache.logging.log4j.core.impl.Log4jLogEvent;
import org.apache.logging.log4j.message.SimpleMessage;
import org.apache.logging.log4j.util.StringMap;
import org.junit.Test;
import java.util.HashMap;
import java.util.Map;
import static org.junit.Assert.assertEquals;
public class Log4j1MdcPatternConverterTest {
@Test
public void testConverter0() {
final Map<String, String> contextMap = new HashMap<>(0);
final StringMap contextMap = ContextDataFactory.createContextData(0);
final String expected = "{}";
test(contextMap, expected, null);
}
@Test
public void testConverter1() {
final Map<String, String> contextMap = new HashMap<>(1);
contextMap.put("key1", "value1");
final StringMap contextMap = ContextDataFactory.createContextData(1);
contextMap.putValue("key1", "value1");
final String expected = "{{key1,value1}}";
test(contextMap, expected, null);
}
@Test
public void testConverter2() {
final Map<String, String> contextMap = new HashMap<>(2);
contextMap.put("key1", "value1");
contextMap.put("key2", "value2");
final StringMap contextMap = ContextDataFactory.createContextData(2);
contextMap.putValue("key1", "value1");
contextMap.putValue("key2", "value2");
final String expected = "{{key1,value1}{key2,value2}}";
test(contextMap, expected, null);
}
@Test
public void testConverterWithKey() {
final Map<String, String> contextMap = new HashMap<>(2);
contextMap.put("key1", "value1");
contextMap.put("key2", "value2");
final StringMap contextMap = ContextDataFactory.createContextData(2);
contextMap.putValue("key1", "value1");
contextMap.putValue("key2", "value2");
final String expected = "value1";
test(contextMap, expected, new String[] {"key1"});
}
private void test(final Map<String, String> contextMap, final String expected, final String[] options) {
private void test(final StringMap contextMap, final String expected, final String[] options) {
final LogEvent event = Log4jLogEvent.newBuilder()
.setLoggerName("MyLogger")
.setLevel(Level.DEBUG)
.setMessage(new SimpleMessage("Hello"))
.setContextMap(contextMap)
.setContextData(contextMap)
.build();
final StringBuilder sb = new StringBuilder();
final Log4j1MdcPatternConverter converter = Log4j1MdcPatternConverter.newInstance(options);
......
......@@ -20,7 +20,7 @@
<parent>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j</artifactId>
<version>2.10.0</version>
<version>2.11.1</version>
<relativePath>../</relativePath>
</parent>
<artifactId>log4j-api-java9</artifactId>
......@@ -60,7 +60,7 @@
<configuration>
<toolchains>
<jdk>
<version>9</version>
<version>[9, )</version>
</jdk>
</toolchains>
</configuration>
......@@ -142,7 +142,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<version>${deploy.plugin.version}</version>
<configuration>
<skip>true</skip>
</configuration>
......
......@@ -32,17 +32,12 @@
<include>**/*.class</include>
</includes>
<excludes>
<exclude>module-info.class</exclude>
<exclude>**/Dummy.class</exclude>
<exclude>**/spi/Provider.class</exclude>
<exclude>**/util/PropertySource.class</exclude>
<exclude>**/message/ThreadDumpMessage.class</exclude>
<exclude>**/message/ThreadDumpMessage$ThreadInfoFactory.class</exclude>
</excludes>
</fileSet>
<fileSet>
<directory>${project.build.outputDirectory}</directory>
<outputDirectory>/classes</outputDirectory>
<includes>
<include>module-info.class</include>
</includes>
</fileSet>
</fileSets>
</assembly>