Repository: logging-log4j2 Updated Branches: refs/heads/master a31a8dc88 -> e1d0d99ea
[LOG4J2-944] Log4j Flume appender is not adding millisecond to the event headers when the event is logged at 000 milliseconds. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/e1d0d99e Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/e1d0d99e Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/e1d0d99e Branch: refs/heads/master Commit: e1d0d99ea10437621269c500f8696107cb2b0923 Parents: a31a8dc Author: Gary Gregory <[email protected]> Authored: Sun Jan 25 20:50:30 2015 -0500 Committer: Gary Gregory <[email protected]> Committed: Sun Jan 25 20:50:30 2015 -0500 ---------------------------------------------------------------------- .../org/apache/logging/log4j/core/layout/Rfc5424Layout.java | 8 ++------ src/changes/changes.xml | 3 +++ 2 files changed, 5 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e1d0d99e/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java index 340c5b3..e1c9399 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/layout/Rfc5424Layout.java @@ -451,12 +451,8 @@ public final class Rfc5424Layout extends AbstractStringLayout { pad(cal.get(Calendar.MINUTE), TWO_DIGITS, buffer); buffer.append(':'); pad(cal.get(Calendar.SECOND), TWO_DIGITS, buffer); - - final int millis = cal.get(Calendar.MILLISECOND); - if (millis != 0) { - buffer.append('.'); - pad(millis, THREE_DIGITS, buffer); - } + buffer.append('.'); + pad(cal.get(Calendar.MILLISECOND), THREE_DIGITS, buffer); int tzmin = (cal.get(Calendar.ZONE_OFFSET) + cal.get(Calendar.DST_OFFSET)) / MILLIS_PER_MINUTE; if (tzmin == 0) { http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/e1d0d99e/src/changes/changes.xml ---------------------------------------------------------------------- diff --git a/src/changes/changes.xml b/src/changes/changes.xml index f25d6f7..afa67fa 100644 --- a/src/changes/changes.xml +++ b/src/changes/changes.xml @@ -24,6 +24,9 @@ </properties> <body> <release version="2.2" date="2015-??-??" description="GA Release 2.2"> + <action issue="LOG4J2-944" dev="ggregory" type="fix" due-to="Vinayaka Ramachandra"> + Log4j Flume appender is not adding millisecond to the event headers when the event is logged at 000 milliseconds. + </action> <action issue="LOG4J2-941" dev="ggregory" type="add" due-to="Konstantinos Liakos"> Allow JSON layout to create one compact log record per line. </action>
