อ่านในภาษาอังกฤษ

แชร์ผ่าน


ConsoleLoggerExtensions.AddSimpleConsole Method

Definition

Overloads

AddSimpleConsole(ILoggingBuilder)

Add the default console log formatter named 'simple' to the factory with default properties.

AddSimpleConsole(ILoggingBuilder, Action<SimpleConsoleFormatterOptions>)

Add and configure a console log formatter named 'simple' to the factory.

AddSimpleConsole(ILoggingBuilder)

Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs

Add the default console log formatter named 'simple' to the factory with default properties.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddSimpleConsole (this Microsoft.Extensions.Logging.ILoggingBuilder builder);

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to use.

Returns

The current logging builder instance so that additional calls can be chained.

Applies to

.NET 9 (package-provided) และรุ่นอื่นๆ
ผลิตภัณฑ์ เวอร์ชัน
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)

AddSimpleConsole(ILoggingBuilder, Action<SimpleConsoleFormatterOptions>)

Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs

Add and configure a console log formatter named 'simple' to the factory.

public static Microsoft.Extensions.Logging.ILoggingBuilder AddSimpleConsole (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Action<Microsoft.Extensions.Logging.Console.SimpleConsoleFormatterOptions> configure);

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to use.

configure
Action<SimpleConsoleFormatterOptions>

A delegate to configure the Microsoft.Extensions.Logging.Console.ConsoleLogger options for the built-in default log formatter.

Returns

The current logging builder instance so that additional calls can be chained.

Applies to

.NET 9 (package-provided) และรุ่นอื่นๆ
ผลิตภัณฑ์ เวอร์ชัน
.NET 6 (package-provided), 7 (package-provided), 8 (package-provided), 9 (package-provided)
.NET Framework 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided)
.NET Standard 2.0 (package-provided)