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 2016/04/16 14:55:04 UTC

[5/5] logging-log4j2 git commit: LOG4J2-1334 the kill switch for MutableLogEvents (currently short-circuited so it always uses Log4jLogEvent)

LOG4J2-1334 the kill switch for MutableLogEvents (currently short-circuited so it always uses Log4jLogEvent)


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

Branch: refs/heads/master
Commit: 328a8bf8f0d80b466d2d5c666c9f7a31d70ba678
Parents: cedf155
Author: rpopma <rp...@apache.org>
Authored: Sat Apr 16 21:52:39 2016 +0900
Committer: rpopma <rp...@apache.org>
Committed: Sat Apr 16 21:52:39 2016 +0900

----------------------------------------------------------------------
 .../java/org/apache/logging/log4j/core/config/LoggerConfig.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/328a8bf8/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
index e5eb9d4..7b030c6 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/LoggerConfig.java
@@ -40,6 +40,7 @@ import org.apache.logging.log4j.core.filter.AbstractFilterable;
 import org.apache.logging.log4j.core.impl.DefaultLogEventFactory;
 import org.apache.logging.log4j.core.impl.Log4jLogEvent;
 import org.apache.logging.log4j.core.impl.LogEventFactory;
+import org.apache.logging.log4j.core.impl.ReusableLogEventFactory;
 import org.apache.logging.log4j.core.lookup.StrSubstitutor;
 import org.apache.logging.log4j.core.util.Booleans;
 import org.apache.logging.log4j.core.util.Constants;
@@ -83,7 +84,9 @@ public class LoggerConfig extends AbstractFilterable {
             }
         }
         if (LOG_EVENT_FACTORY == null) {
-            LOG_EVENT_FACTORY = new DefaultLogEventFactory();
+            LOG_EVENT_FACTORY = false //Constants.ENABLE_THREADLOCALS
+                    ? new ReusableLogEventFactory()
+                    : new DefaultLogEventFactory();
         }
     }