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/LOG4J2-1365 Commit: 328a8bf8f0d80b466d2d5c666c9f7a31d70ba678 Parents: cedf155 Author: rpopma <[email protected]> Authored: Sat Apr 16 21:52:39 2016 +0900 Committer: rpopma <[email protected]> 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(); } }
