Repository: logging-log4j2 Updated Branches: refs/heads/master 384e929d5 -> a3cd18e69
LOG4J2-2250 (configurable status logger timestamps) bugfix: use PropertiesUtil instead of System properties; set showDateTime flag (cherry picked from commit 629fa2f) Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/a3cd18e6 Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/a3cd18e6 Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/a3cd18e6 Branch: refs/heads/master Commit: a3cd18e694674fd01e0d36b73e68161ee8197962 Parents: 384e929 Author: rpopma <rpo...@apache.org> Authored: Fri Feb 16 21:39:46 2018 +0900 Committer: rpopma <rpo...@apache.org> Committed: Fri Feb 16 21:40:37 2018 +0900 ---------------------------------------------------------------------- .../java/org/apache/logging/log4j/status/StatusLogger.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/a3cd18e6/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java index 57da8f9..3f9f6f3 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/status/StatusLogger.java @@ -103,9 +103,10 @@ public final class StatusLogger extends AbstractLogger { private StatusLogger(final String name, final MessageFactory messageFactory) { super(name, messageFactory); - this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, false, false, - System.getProperty(STATUS_DATE_FORMAT, Strings.EMPTY), - messageFactory, PROPS, System.err); + final String dateFormat = PROPS.getStringProperty(STATUS_DATE_FORMAT, Strings.EMPTY); + final boolean showDateTime = !Strings.isEmpty(dateFormat); + this.logger = new SimpleLogger("StatusLogger", Level.ERROR, false, true, showDateTime, false, + dateFormat, messageFactory, PROPS, System.err); this.listenersLevel = Level.toLevel(DEFAULT_STATUS_LEVEL, Level.WARN).intLevel(); // LOG4J2-1813 if system property "log4j2.debug" is defined, print all status logging