You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by gg...@apache.org on 2014/11/23 06:17:42 UTC

logging-log4j2 git commit: [LOG4J2-903] ClassLoaderContextSelector uses ClassLoader.toString() as a key.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 34c00ef8b -> 4851c5ac2


[LOG4J2-903] ClassLoaderContextSelector uses ClassLoader.toString() as a
key.

Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/4851c5ac
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/4851c5ac
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/4851c5ac

Branch: refs/heads/master
Commit: 4851c5ac2133656738845316a59f076d33284583
Parents: 34c00ef
Author: Gary Gregory <ga...@gmail.com>
Authored: Sun Nov 23 00:17:39 2014 -0500
Committer: Gary Gregory <ga...@gmail.com>
Committed: Sun Nov 23 00:17:39 2014 -0500

----------------------------------------------------------------------
 .../logging/log4j/core/selector/ClassLoaderContextSelector.java   | 2 +-
 src/changes/changes.xml                                           | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4851c5ac/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
index 44b70ad..26f81ad 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/selector/ClassLoaderContextSelector.java
@@ -169,7 +169,7 @@ public class ClassLoaderContextSelector implements ContextSelector {
     }
 
     private String toContextMapKey(final ClassLoader loader) {
-        return loader.toString();
+        return String.valueOf(System.identityHashCode(loader));
     }
 
     protected LoggerContext getDefault() {

http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/4851c5ac/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index b55ce56..6a86405 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -32,6 +32,9 @@
         Specify the SocketAppender connect timeout value as part of the configuration.
         The new appender takes a new parameter connectTimeoutMillis.
       </action>
+      <action issue="LOG4J2-903" dev="ggregory" type="fix" due-to="Mauro Molinari">
+        ClassLoaderContextSelector uses ClassLoader.toString() as a key
+      </action>
       <action issue="LOG4J2-893" dev="ggregory" type="fix">
         NullPointerException on filter when mapping JUL to Log4j2.
       </action>