From 27094b7ed95f6f631871aa18d08bfedf22e83f36 Mon Sep 17 00:00:00 2001 From: cretzbach Date: Fri, 4 Apr 2025 14:08:12 +0200 Subject: [PATCH 1/2] Update logger pattern examples and description The description of the logger precision using periods was confusing and the examples were wrong. This commit fixes the description, the wrong examples and adds one more example for clarification. --- .../modules/ROOT/pages/manual/pattern-layout.adoc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc index d3f713e7942..d5d3df7effe 100644 --- a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc @@ -911,8 +911,8 @@ A logger conversion specifier can be optionally followed by a _precision specifi * When the precision specifier is an integer value, it reduces the size of the logger name. If the number is positive, the layout prints the corresponding number of the rightmost logger name components. If negative, the layout removes the corresponding number of leftmost logger name components. -* If the precision contains periods then the number before the first period identifies the length to be printed from items that precede tokens in the rest of the pattern. -If the number after the first period is followed by an asterisk it indicates how many of the rightmost tokens will be printed in full. +* If the precision contains periods then the number before the period identifies the length to be printed from items that precede the matching period in the logger name. +An asterix can be used as a wildecard to print the whole logger name component before a period. * If the precision contains any non-integer characters, then the layout abbreviates the name based on the pattern. If the precision integer is less than one, the layout still prints the right-most token in full. @@ -966,15 +966,19 @@ See the table below for abbreviation examples: |%c{1.2.*} |org.apache.commons.test.Foo -|o.a.c.test.Foo +|o.ap.common.test.Foo |%c{1.3.*} |org.apache.commons.test.Foo -|o.a.commons.test.Foo +|o.apa.commons.test.Foo |%c{1.8.*} |org.apache.commons.test.Foo +|o.apache.commons.test.Foo + +|%c{1.*.1} |org.apache.commons.test.Foo +|o.apache.c.test.Foo |=== [#converter-marker] From 569414d25c3c17f1f602003be21683cfee55719e Mon Sep 17 00:00:00 2001 From: cretzbach Date: Fri, 4 Apr 2025 14:18:18 +0200 Subject: [PATCH 2/2] Fix typos Small typos in the explanation of the logger precision usage. --- src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc index d5d3df7effe..bc6161e01bd 100644 --- a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc @@ -912,7 +912,7 @@ A logger conversion specifier can be optionally followed by a _precision specifi If the number is positive, the layout prints the corresponding number of the rightmost logger name components. If negative, the layout removes the corresponding number of leftmost logger name components. * If the precision contains periods then the number before the period identifies the length to be printed from items that precede the matching period in the logger name. -An asterix can be used as a wildecard to print the whole logger name component before a period. +An asterisk can be used as a wildcard to print the whole logger name component before a period. * If the precision contains any non-integer characters, then the layout abbreviates the name based on the pattern. If the precision integer is less than one, the layout still prints the right-most token in full.