You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rp...@apache.org on 2015/08/18 18:50:09 UTC

logging-log4j2 git commit: partially reverted change: LogEvent.contextStack is a mutable copy. Changing this to immutable may break client code.

Repository: logging-log4j2
Updated Branches:
  refs/heads/master 7257b8839 -> 973031594


partially reverted change: LogEvent.contextStack is a mutable copy.
Changing this to immutable may break client code.

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

Branch: refs/heads/master
Commit: 973031594c23ca0022d6e9b1042536a365ae7292
Parents: 7257b88
Author: rpopma <rp...@apache.org>
Authored: Wed Aug 19 01:50:09 2015 +0900
Committer: rpopma <rp...@apache.org>
Committed: Wed Aug 19 01:50:09 2015 +0900

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java     | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/97303159/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
index 3305bf8..256c6b4 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/impl/Log4jLogEvent.java
@@ -270,7 +270,7 @@ public class Log4jLogEvent implements LogEvent {
                         final Message message, final List<Property> properties, final Throwable t) {
        this(loggerName, marker, loggerFQCN, level, message, t, null,
            createMap(properties),
-           ThreadContext.getImmutableStack(), // may be ThreadContext.EMPTY_STACK but not null
+           ThreadContext.getDepth() == 0 ? null : ThreadContext.cloneStack(), // mutable copy
            null, // thread name
            null, // stack trace element
            // LOG4J2-628 use log4j.Clock for timestamps