Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ltrzesniewski committed Jul 23, 2024
1 parent c2e62e5 commit 8e7fccc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,18 +130,18 @@ The output format of the built-in appenders may be customized through the `Forma

The prefix pattern is a string with the following placeholders:

| Placeholder | Effect | Format |
|------------------|---------------------------------------------------------------|------------------------------------------------------------|
| `%date` | The message date in UTC | A `DateTime` format string, default: `yyyy-MM-dd` |
| `%localDate` | The message date converted to the local time zone | A `DateTime` format string, default: `yyyy-MM-dd` |
| `%time` | The message timestamp in UTC | A `TimeSpan` format string, default: `hh\:mm\:ss\.fffffff` |
| `%localTime` | The message timestamp converted to the local time zone | A `TimeSpan` format string, default: `hh\:mm\:ss\.fffffff` |
| `%thread` | The thread name (or ID) which logged the message | |
| `%level` | The log level in uppercase | `pad` is equivalent to `5` (the longest level length) |
| `%logger` | The logger name | |
| `%loggerCompact` | The logger name, with the namespace shortened to its initials | |
| `%newline` | Equivalent to `Environment.NewLine` | |
| `%column` | Inserts padding spaces until a given column index | The column index to reach |
| Placeholder | Effect | Format |
|------------------|------------------------------------------------------------------|------------------------------------------------------------|
| `%date` | The message date in UTC (recommended, also contains time of day) | A `DateTime` format string, default: `yyyy-MM-dd` |
| `%localDate` | The message date converted to the local time zone | A `DateTime` format string, default: `yyyy-MM-dd` |
| `%time` | The message time of day (in UTC) | A `TimeSpan` format string, default: `hh\:mm\:ss\.fffffff` |
| `%localTime` | The message time of day (converted to the local time zone) | A `TimeSpan` format string, default: `hh\:mm\:ss\.fffffff` |
| `%thread` | The thread name (or ID) which logged the message | |
| `%level` | The log level in uppercase | `pad` is equivalent to `5` (the longest level length) |
| `%logger` | The logger name | |
| `%loggerCompact` | The logger name, with the namespace shortened to its initials | |
| `%newline` | Equivalent to `Environment.NewLine` | |
| `%column` | Inserts padding spaces until a given column index | The column index to reach |

Prefixes can be written in the form `%{prefix}` or `%{prefix:format}` to define a format string. String placeholders accept an integer format string which defines their minimum length. For instance, `%{logger:20}` will always be at least 20 characters wide.

Expand Down
6 changes: 3 additions & 3 deletions src/ZeroLog.Impl.Full/Formatting/DefaultFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ public sealed class DefaultFormatter : Formatter
/// <para>
/// The pattern is a string containing placeholders:
/// <list type="table">
/// <item><term><c>%date</c></term><description>The message UTC date (default format: <c>yyyy-MM-dd</c>).</description></item>
/// <item><term><c>%date</c></term><description>The message UTC date (recommended, default format: <c>yyyy-MM-dd</c>).</description></item>
/// <item><term><c>%localDate</c></term><description>The message local date (default format: <c>yyyy-MM-dd</c>).</description></item>
/// <item><term><c>%time</c></term><description>The message UTC timestamp (default format: <c>hh\:mm\:ss\.fffffff</c>).</description></item>
/// <item><term><c>%localTime</c></term><description>The message local timestamp (default format: <c>hh\:mm\:ss\.fffffff</c>).</description></item>
/// <item><term><c>%time</c></term><description>The message time of day in UTC (default format: <c>hh\:mm\:ss\.fffffff</c>).</description></item>
/// <item><term><c>%localTime</c></term><description>The message time of day converted to the local time zone (default format: <c>hh\:mm\:ss\.fffffff</c>).</description></item>
/// <item><term><c>%thread</c></term><description>The thread name (or ID) which logged the message.</description></item>
/// <item><term><c>%level</c></term><description>The log level in uppercase (specify the <c>pad</c> format to make each level 5 characters wide).</description></item>
/// <item><term><c>%logger</c></term><description>The logger name.</description></item>
Expand Down

0 comments on commit 8e7fccc

Please sign in to comment.