You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2019/06/20 14:49:17 UTC
[logging-log4j2] 02/03: [LOG4J2-2403] Update documentation about
zero-padding
This is an automated email from the ASF dual-hosted git repository.
rgoers pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 94567fc6f345406fbdb754d32ce2528ad7bcaf5c
Author: Marco Herrn <ma...@mherrn.de>
AuthorDate: Tue Oct 23 14:45:33 2018 +0200
[LOG4J2-2403] Update documentation about zero-padding
---
src/site/asciidoc/manual/appenders.adoc | 5 ++++-
src/site/asciidoc/manual/layouts.adoc | 3 ++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/site/asciidoc/manual/appenders.adoc b/src/site/asciidoc/manual/appenders.adoc
index 2015b77..05fb7b9 100644
--- a/src/site/asciidoc/manual/appenders.adoc
+++ b/src/site/asciidoc/manual/appenders.adoc
@@ -2546,7 +2546,10 @@ file. The format of the pattern is dependent on the RolloverPolicy that
is used. The DefaultRolloverPolicy will accept both a date/time pattern
compatible with
https://download.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html[`SimpleDateFormat`]
-and/or a %i which represents an integer counter. The pattern also
+and/or a %i which represents an integer counter. The integer counter
+allows specifying a padding, like %3i for space-padding the counter to
+3 digits or (usually more useful) %03i for zero-padding the counter to
+3 digits. The pattern also
supports interpolation at runtime so any of the Lookups (such as the
link:./lookups.html#DateLookup[DateLookup]) can be included in the
pattern.
diff --git a/src/site/asciidoc/manual/layouts.adoc b/src/site/asciidoc/manual/layouts.adoc
index 316c67b..8f770d6 100644
--- a/src/site/asciidoc/manual/layouts.adoc
+++ b/src/site/asciidoc/manual/layouts.adoc
@@ -1509,7 +1509,8 @@ minimum width is reached. The default is to pad on the left (right
justify) but you can specify right padding with the left justification
flag. The padding character is space. If the data item is larger than
the minimum field width, the field is expanded to accommodate the data.
-The value is never truncated.
+The value is never truncated. To use zeros as the padding character prepend
+the _minimum field width_ with a zero.
This behavior can be changed using the _maximum field width_ modifier
which is designated by a period followed by a decimal constant. If the