ConsoleLoggerExtensions Class

Namespace
Microsoft.Extensions.Logging
Assemblies
  • Microsoft.Extensions.Logging.Console

Syntax

public class ConsoleLoggerExtensions
class Microsoft.Extensions.Logging.ConsoleLoggerExtensions

Methods

AddConsole(Microsoft.Extensions.Logging.ILoggerFactory)

Adds a console logger that is enabled for Microsoft.Extensions.Logging.LogLevel.Information or higher.

Return type:Microsoft.Extensions.Logging.ILoggerFactory
public static ILoggerFactory AddConsole(this ILoggerFactory factory)
AddConsole(Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Extensions.Configuration.IConfiguration)
Return type:Microsoft.Extensions.Logging.ILoggerFactory
public static ILoggerFactory AddConsole(this ILoggerFactory factory, IConfiguration configuration)
AddConsole(Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Extensions.Logging.Console.IConsoleLoggerSettings)
Return type:Microsoft.Extensions.Logging.ILoggerFactory
public static ILoggerFactory AddConsole(this ILoggerFactory factory, IConsoleLoggerSettings settings)
AddConsole(Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Extensions.Logging.LogLevel)

Adds a console logger that is enabled for Microsoft.Extensions.Logging.LogLevels of minLevel or higher.

Arguments:
Return type:

Microsoft.Extensions.Logging.ILoggerFactory

public static ILoggerFactory AddConsole(this ILoggerFactory factory, LogLevel minLevel)
AddConsole(Microsoft.Extensions.Logging.ILoggerFactory, Microsoft.Extensions.Logging.LogLevel, System.Boolean)

Adds a console logger that is enabled for Microsoft.Extensions.Logging.LogLevels of minLevel or higher.

Arguments:
Return type:

Microsoft.Extensions.Logging.ILoggerFactory

public static ILoggerFactory AddConsole(this ILoggerFactory factory, LogLevel minLevel, bool includeScopes)
AddConsole(Microsoft.Extensions.Logging.ILoggerFactory, System.Boolean)

Adds a console logger that is enabled for Microsoft.Extensions.Logging.LogLevel.Information or higher.

Arguments:includeScopes (System.Boolean) – A value which indicates whether log scope information should be displayed in the output.
Return type:Microsoft.Extensions.Logging.ILoggerFactory
public static ILoggerFactory AddConsole(this ILoggerFactory factory, bool includeScopes)
AddConsole(Microsoft.Extensions.Logging.ILoggerFactory, System.Func<System.String, Microsoft.Extensions.Logging.LogLevel, System.Boolean>)

Adds a console logger that is enabled as defined by the filter function.

Return type:Microsoft.Extensions.Logging.ILoggerFactory
public static ILoggerFactory AddConsole(this ILoggerFactory factory, Func<string, LogLevel, bool> filter)
AddConsole(Microsoft.Extensions.Logging.ILoggerFactory, System.Func<System.String, Microsoft.Extensions.Logging.LogLevel, System.Boolean>, System.Boolean)

Adds a console logger that is enabled as defined by the filter function.

Arguments:includeScopes (System.Boolean) – A value which indicates whether log scope information should be displayed in the output.
Return type:Microsoft.Extensions.Logging.ILoggerFactory
public static ILoggerFactory AddConsole(this ILoggerFactory factory, Func<string, LogLevel, bool> filter, bool includeScopes)