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/04/07 12:34:36 UTC
logging-log4j2 git commit: LOG4J2-991: Async root logger config
should default includeLocation to false
Repository: logging-log4j2
Updated Branches:
refs/heads/master b76a9b2de -> 3cee912e3
LOG4J2-991: Async root logger config should default includeLocation to
false
Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/3cee912e
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/3cee912e
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/3cee912e
Branch: refs/heads/master
Commit: 3cee912e394f6b6eca7d9913b60884027c92fd1b
Parents: b76a9b2
Author: rpopma <rp...@apache.org>
Authored: Tue Apr 7 19:34:32 2015 +0900
Committer: rpopma <rp...@apache.org>
Committed: Tue Apr 7 19:34:32 2015 +0900
----------------------------------------------------------------------
.../log4j/core/async/AsyncLoggerConfig.java | 2 +-
.../log4j/core/async/AsyncLoggerConfigTest.java | 17 +++++++++++++++++
src/changes/changes.xml | 3 +++
3 files changed, 21 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3cee912e/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
index 9e1cd9a..f87d4e3 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/async/AsyncLoggerConfig.java
@@ -236,7 +236,7 @@ public class AsyncLoggerConfig extends LoggerConfig {
return new AsyncLoggerConfig(LogManager.ROOT_LOGGER_NAME,
appenderRefs, filter, level, additive, properties, config,
- includeLocation(includeLocation));
+ AsyncLoggerConfig.includeLocation(includeLocation));
}
}
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3cee912e/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest.java
----------------------------------------------------------------------
diff --git a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest.java b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest.java
index 13d212a..42bd306 100644
--- a/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest.java
+++ b/log4j-core/src/test/java/org/apache/logging/log4j/core/async/AsyncLoggerConfigTest.java
@@ -24,7 +24,9 @@ import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.core.LifeCycle;
import org.apache.logging.log4j.core.CoreLoggerContexts;
+import org.apache.logging.log4j.core.config.AppenderRef;
import org.apache.logging.log4j.core.config.ConfigurationFactory;
+import org.apache.logging.log4j.core.config.LoggerConfig;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -60,4 +62,19 @@ public class AsyncLoggerConfigTest {
final String location = "testAdditivity";
assertTrue("location", line1.contains(location) || line2.contains(location));
}
+
+ @Test
+ public void testIncludeLocationDefaultsToFalse() {
+ LoggerConfig rootLoggerConfig =
+ AsyncLoggerConfig.RootLogger.createLogger(
+ null, "INFO", null, new AppenderRef[0], null, null, null);
+ assertFalse("Include location should default to false for async logggers",
+ rootLoggerConfig.isIncludeLocation());
+
+ LoggerConfig loggerConfig =
+ AsyncLoggerConfig.createLogger(
+ null, "INFO", "com.foo.Bar", null, new AppenderRef[0], null, null, null);
+ assertFalse("Include location should default to false for async logggers",
+ loggerConfig.isIncludeLocation());
+ }
}
http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/3cee912e/src/changes/changes.xml
----------------------------------------------------------------------
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index f149473..5fc76de 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -24,6 +24,9 @@
</properties>
<body>
<release version="2.3" date="2015-0?-??" description="GA Release 2.3">
+ <action issue="LOG4J2-991" dev="rpopma" type="fix" due-to="Ryan Rupp">
+ Async root logger config should default includeLocation to false.
+ </action>
<action issue="LOG4J2-985" dev="rpopma" type="fix" due-to="Sean Dawson">
AbstractFilter should not implement equals() and hashCode().
</action>