Skip to content

Update pattern logger precision example and description #3588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.

Expand Down Expand Up @@ -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]
Expand Down