ConsoleLoggerExtensions.AddJsonConsole 方法

定义

重载

AddJsonConsole(ILoggingBuilder)

使用默认属性将名为“json”的控制台日志格式化程序添加到工厂。

AddJsonConsole(ILoggingBuilder, Action<JsonConsoleFormatterOptions>)

将名为“json”的控制台日志格式化程序添加到使用指定的 Json 控制台格式化程序选项配置的工厂。

AddJsonConsole(ILoggingBuilder)

Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs

使用默认属性将名为“json”的控制台日志格式化程序添加到工厂。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddJsonConsole(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddJsonConsole (this Microsoft.Extensions.Logging.ILoggingBuilder builder);
static member AddJsonConsole : Microsoft.Extensions.Logging.ILoggingBuilder -> Microsoft.Extensions.Logging.ILoggingBuilder
<Extension()>
Public Function AddJsonConsole (builder As ILoggingBuilder) As ILoggingBuilder

参数

builder
ILoggingBuilder

要使用的最新日志记录生成器实例。

返回

最新日志记录生成器实例,以便可以链接其他调用。

适用于

AddJsonConsole(ILoggingBuilder, Action<JsonConsoleFormatterOptions>)

Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs
Source:
ConsoleLoggerExtensions.cs

将名为“json”的控制台日志格式化程序添加到使用指定的 Json 控制台格式化程序选项配置的工厂。

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddJsonConsole(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder, Action<Microsoft::Extensions::Logging::Console::JsonConsoleFormatterOptions ^> ^ configure);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddJsonConsole (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Action<Microsoft.Extensions.Logging.Console.JsonConsoleFormatterOptions> configure);
static member AddJsonConsole : Microsoft.Extensions.Logging.ILoggingBuilder * Action<Microsoft.Extensions.Logging.Console.JsonConsoleFormatterOptions> -> Microsoft.Extensions.Logging.ILoggingBuilder
<Extension()>
Public Function AddJsonConsole (builder As ILoggingBuilder, configure As Action(Of JsonConsoleFormatterOptions)) As ILoggingBuilder

参数

builder
ILoggingBuilder

要使用的最新日志记录生成器实例。

configure
Action<JsonConsoleFormatterOptions>

用于为内置 json 日志格式化程序配置控制台记录器选项的委托。

返回

最新日志记录生成器实例,以便可以链接其他调用。

适用于