public class ConsoleLogger : ILogger
IDisposable BeginScope(TState state)
bool IsEnabled(LogLevel logLevel)
void Log(LogLevel logLevel, EventId eventId, TState state, Exception exception, Func<TState, Exception, string> formatter)
public class ConsoleLoggerConfiguration
AllowMarkupSummary: Gets or sets a value indicating whether the Spectre-markup is allowed.
ConsoleConfiguration
ConsoleSettings
IncludeExceptionNameForExceptionSummary: Gets or sets a value indicating whether the exception-name should be rendered.
IncludeInnerMessageForExceptionSummary: Gets or sets a value indicating whether the inner-exception-message should be rendered.
MinimumLogLevelSummary: Gets or sets the minimum log level. If set to Information, then Trace and Debug will not be included.
Remarks: The ordered list:
Trace, Debug, Information, Warning, Error, Critical.
RenderingModeSummary: Gets or sets the rendering mode.
Remarks: The options:
Default, LogLevel, CategoryName, LogLevelAndCategoryName.
TimestampFormatSummary: Gets or sets a value indicating whether the Timestamp should be rendered with the custom format.
Remarks: UseTimestamp setting has to be set in order for this setting to take effect.
The format has to be in a valid DateTime.ToString([TimestampFormat]) format.
Read more: https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tostring?view=net-6.0
UseShortNameForLogLevelSummary: Gets or sets a value indicating whether the LogLevel should be rendered.
UseTimestampSummary: Gets or sets a value indicating whether the Timestamp should be rendered.
UseTimestampUtcSummary: Gets or sets a value indicating whether the Timestamp should be rendered as UTC.
Remarks: UseTimestamp setting has to be set in order for this setting to take effect.
string ToString()
public class ConsoleLoggerProvider : ILoggerProvider, IDisposable
ILogger CreateLogger(string categoryName)
void Dispose()
public enum ConsoleRenderingMode
Value | Name | Description | Summary |
---|---|---|---|
0 | Default | Default | |
1 | LogLevel | Log Level | |
2 | CategoryName | Category Name | |
3 | LogLevelAndCategoryName | Log Level And Category Name |