Repository: logging-log4j2 Updated Branches: refs/heads/master baea9914f -> 0e15ec3e8
Refactor magic strings. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/0e15ec3e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/0e15ec3e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/0e15ec3e Branch: refs/heads/master Commit: 0e15ec3e8b6ef68a34310b1b5aeb97a898960fd2 Parents: baea991 Author: Gary Gregory <ggreg...@apache.org> Authored: Wed Sep 28 19:10:43 2016 -0700 Committer: Gary Gregory <ggreg...@apache.org> Committed: Wed Sep 28 19:10:43 2016 -0700 ---------------------------------------------------------------------- .../apache/logging/log4j/simple/SimpleLoggerContext.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/0e15ec3e/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java b/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java index 3fe637f..fe460c6 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/simple/SimpleLoggerContext.java @@ -33,6 +33,10 @@ import org.apache.logging.log4j.util.PropertiesUtil; */ public class SimpleLoggerContext implements LoggerContext { + private static final String SYSTEM_OUT = "system.out"; + + private static final String SYSTEM_ERR = "system.err"; + /** The default format to use when formatting dates */ protected static final String DEFAULT_DATE_TIME_FORMAT = "yyyy/MM/dd HH:mm:ss:SSS zzz"; @@ -75,11 +79,11 @@ public class SimpleLoggerContext implements LoggerContext { dateTimeFormat = showDateTime ? props.getStringProperty(SimpleLoggerContext.SYSTEM_PREFIX + "dateTimeFormat", DEFAULT_DATE_TIME_FORMAT) : null; - final String fileName = props.getStringProperty(SYSTEM_PREFIX + "logFile", "system.err"); + final String fileName = props.getStringProperty(SYSTEM_PREFIX + "logFile", SYSTEM_ERR); PrintStream ps; - if ("system.err".equalsIgnoreCase(fileName)) { + if (SYSTEM_ERR.equalsIgnoreCase(fileName)) { ps = System.err; - } else if ("system.out".equalsIgnoreCase(fileName)) { + } else if (SYSTEM_OUT.equalsIgnoreCase(fileName)) { ps = System.out; } else { try {