Conversion Character | Effect |
c |
The category of the logging event |
C |
The qualified class name of the caller |
d |
The date of the logging event |
F |
The file name where the logging request was issued |
l |
The location information (i.e. method) of the caller |
L |
The line number |
m |
The application-supplied message |
M |
The method name |
n |
The platform-specific line separator |
p |
The priority of the logging event |
r |
The milliseconds elapsed from the layout construction until the logging event creation |
t |
The name of the thread that generated the logging event |
x |
The NDC (nested diagnostic context) associated with the thread that generated the logging event |
X |
the MDC (mapped diagnostic context) associated with the thread that generated the logging event |
% |
The sequence %% outputs a single percent sign |
Conversion Character | Effect |
c{length}
lo{length}
logger{length} |
Outputs the name of the logger at the origin of the logging event. |
C{length}
class{length} |
Outputs the fully-qualified class name of the caller issuing the logging request. |
contextName
cn |
Outputs the name of the logger context to which the logger at the origin of the event was attached to. |
d{pattern}
date{pattern} |
Used to output the date of the logging event |
F / file |
Outputs the file name where the logging request was issued. |
caller{depth} |
Outputs location information of the caller which generated the logging event. |
L / line |
Outputs the line number from where the logging request was issued. |
m / msg / message |
Outputs the application-supplied message associated with the logging event. |
M / method |
Outputs the method name where the logging request was issued. |
n |
Outputs the platform dependent line separator character or characters. |
p / le / level |
Outputs the level of the logging event. |
r / relative |
Outputs the number of milliseconds elapsed since the start of the application. |
t / thread |
Outputs the name of the thread that generated the logging event. |
X{key:-defaultVal}
mdc{key:-defaultVal} |
Outputs the MDC (mapped diagnostic context) associated with the thread. |
ex{depth}
exception{depth}
throwable{depth} |
Outputs the stack trace of the exception associated with the logging event, if any. |
xEx{depth}
xException{depth}
xThrowable{depth} |
Same as the %throwable conversion word above with the addition of class packaging information. |
nopex
nopexception |
Although it pretends to handle stack trace data, this conversion word does not output any data, thus, effectively ignoring exceptions. |
marker |
Outputs the marker associated with the logger request. |
property{key} |
Outputs the value associated with a property named key. |
replace(p){r, t} |
Replaces occurrences of 'r', a regex, with its replacement 't' in the string produces by the sub-pattern 'p'. |
rEx{depth}
rootException{depth} |
Outputs the stack trace of the exception associated with the logging event, if any. |