Class CustomStdoutFormatter
Custom stdout formatter.
public sealed class CustomStdoutFormatter : ConsoleFormatter
- Inheritance
-
CustomStdoutFormatter
- Inherited Members
- Extension Methods
Remarks
This custom formatter generates log entries with this format:
{timestamp} [{level}] {category}: {message?} {exception?}{newline}
Constructors
CustomStdoutFormatter(IOptions<CustomStdoutFormatterOptions>)
Ctor from opt
.
public CustomStdoutFormatter(IOptions<CustomStdoutFormatterOptions> opt)
Parameters
Fields
NAME
Custom stdout formatter name.
public const string NAME = "stdoutFormat"
Field Value
Methods
Write<TState>(in LogEntry<TState>, IExternalScopeProvider?, TextWriter)
public override void Write<TState>(in LogEntry<TState> logEntry, IExternalScopeProvider? scopeProvider, TextWriter textWriter)
Parameters
logEntry
LogEntry<TState>scopeProvider
IExternalScopeProvidertextWriter
TextWriter
Type Parameters
TState