Repository: logging-log4j2 Updated Branches: refs/heads/release-2.x e83d0faf2 -> 629fa2fe6
LOG4J2-2250 (configurable status logger timestamps) bugfix: use PropertiesUtil instead of System properties; set showDateTime flag Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/629fa2fe Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/629fa2fe Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/629fa2fe Branch: refs/heads/release-2.x Commit: 629fa2fe65dc1bee2120900d246067887f2cfdf5 Parents: e83d0fa Author: rpopma <rpo...@apache.org> Authored: Fri Feb 16 21:39:46 2018 +0900 Committer: rpopma <rpo...@apache.org> Committed: Fri Feb 16 21:39:46 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/629fa2fe/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