Looks like this commit is causing a test failure. AsyncLoggerContextSelectorTest.testContextNameIsAsyncLoggerContext:58 expected:<AsyncLoggerContext[]> but was:<AsyncLoggerContext[@549581070]>
I'll take a look at fixing it, but it should be simple. ---------- Forwarded message ---------- From: <[email protected]> Date: 5 July 2014 20:58 Subject: svn commit: r1608149 - in /logging/log4j/log4j2/trunk: log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java src/changes/changes.xml To: [email protected] Author: rpopma Date: Sun Jul 6 01:58:13 2014 New Revision: 1608149 URL: http://svn.apache.org/r1608149 Log: LOG4J2-666: AsyncLoggerContextSelector should ensure that different AsyncLoggerContext objects created by web application classloaders have unique names Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java logging/log4j/log4j2/trunk/src/changes/changes.xml Modified: logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java?rev=1608149&r1=1608148&r2=1608149&view=diff ============================================================================== --- logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java (original) +++ logging/log4j/log4j2/trunk/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerContextSelector.java Sun Jul 6 01:58:13 2014 @@ -29,7 +29,9 @@ import org.apache.logging.log4j.core.sel */ public class AsyncLoggerContextSelector implements ContextSelector { - private static final AsyncLoggerContext CONTEXT = new AsyncLoggerContext("AsyncLoggerContext"); + // LOG4J2-666 ensure unique name across separate instances created by webapp classloaders + private static final AsyncLoggerContext CONTEXT = new AsyncLoggerContext("AsyncLoggerContext@" + + AsyncLoggerContext.class.hashCode()); @Override public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext) { @@ -44,7 +46,8 @@ public class AsyncLoggerContextSelector } @Override - public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext, final URI configLocation) { + public LoggerContext getContext(final String fqcn, final ClassLoader loader, final boolean currentContext, + final URI configLocation) { return CONTEXT; } Modified: logging/log4j/log4j2/trunk/src/changes/changes.xml URL: http://svn.apache.org/viewvc/logging/log4j/log4j2/trunk/src/changes/changes.xml?rev=1608149&r1=1608148&r2=1608149&view=diff ============================================================================== --- logging/log4j/log4j2/trunk/src/changes/changes.xml (original) +++ logging/log4j/log4j2/trunk/src/changes/changes.xml Sun Jul 6 01:58:13 2014 @@ -22,6 +22,9 @@ </properties> <body> <release version="2.0-???" date="2014-0M-DD" description="Bug fixes and enhancements"> + <action issue="LOG4J2-666" dev="rpopma" type="fix"> + AsyncLoggerContextSelector should ensure that different AsyncLoggerContext objects created by web app classloaders have unique names. + </action> <action issue="LOG4J2-683" dev="mattsicker" type="fix" due-to="Jurriaan Mous"> Fix annotation processor warnings on JDK 1.7+. </action> -- Matt Sicker <[email protected]>
