Formatting
Specify the formatting of you logs using a string with placeholders that get replaced with information.
A placeholder is build up the following:
- The capitalized letter specifies the type of the placeholder.
- The argument property.
- Each placeholder starts and ends with
$
- The prefix property.
- The suffix property.
Tip
To write $
to your log write $$
in your format string.
The following properties are currently available.
Note
Prefix and suffix properties cannot contain nested placeholders.
Property | Description |
---|---|
p{...} |
Prefix that will be displayed before of the information. |
s{...} |
Suffix that will be displayed after the information. |
a{...} |
Arguments that some placeholders need to specify their formatting. |
i{...} |
Indentation that will be displayed before every line. |
l{num,char} |
Padding left that will be displayed before the prefix |
r{num,char} |
Padding right that will be displayed after the suffix |
The order of suffix, paddings, prefix etc. is the following: indentation
[pad left][prefix][indentation (each line)][content of placeholder][suffix][pad right]
List of placeholders¶
Placeholder | Description | Arguments |
---|---|---|
C |
The namespace and class of the source. | |
F |
The source function. | l for the whole function definition.s or empty for a short version. |
D |
The timestamp. | Date and time format string or empty for standard format of your culture. |
E |
The exception of the log source if available. | |
L |
The log level. | l or empty for a written log level.u for a written log level in uppercase.s for the short form specified in the level settings. |
M |
The message. | |
S |
The stack trace if available. | |
T |
The tag if available. |