ConsoleLoggerExtensions.AddConsole Method

Definition

Overloads

AddConsole(ILoggerFactory)

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

AddConsole(ILoggingBuilder)

Adds a console logger named 'Console' to the factory.

AddConsole(ILoggerFactory, IConfiguration)
AddConsole(ILoggerFactory, IConsoleLoggerSettings)
AddConsole(ILoggerFactory, LogLevel)

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

AddConsole(ILoggerFactory, Boolean)

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

AddConsole(ILoggerFactory, Func<String,LogLevel,Boolean>)

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

AddConsole(ILoggingBuilder, Action<ConsoleLoggerOptions>)

Adds a console logger named 'Console' to the factory.

AddConsole(ILoggerFactory, LogLevel, Boolean)

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

AddConsole(ILoggerFactory, Func<String,LogLevel,Boolean>, Boolean)

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

AddConsole(ILoggerFactory)

Warning

This API is now obsolete.

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

Returns

Attributes

AddConsole(ILoggingBuilder)

Adds a console logger named 'Console' to the factory.

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

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to use.

Returns

AddConsole(ILoggerFactory, IConfiguration)

Warning

This API is now obsolete.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, Microsoft::Extensions::Configuration::IConfiguration ^ configuration);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory, Microsoft.Extensions.Configuration.IConfiguration configuration);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Extensions.Configuration.IConfiguration -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory, configuration As IConfiguration) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

configuration
IConfiguration

The IConfiguration to use for IConsoleLoggerSettings.

Returns

Attributes

AddConsole(ILoggerFactory, IConsoleLoggerSettings)

Warning

This API is now obsolete.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, Microsoft::Extensions::Logging::Console::IConsoleLoggerSettings ^ settings);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory, Microsoft.Extensions.Logging.Console.IConsoleLoggerSettings settings);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Extensions.Logging.Console.IConsoleLoggerSettings -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory, settings As IConsoleLoggerSettings) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

settings
IConsoleLoggerSettings

The settings to apply to created ConsoleLogger's.

Returns

Attributes

AddConsole(ILoggerFactory, LogLevel)

Warning

This API is now obsolete.

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, Microsoft::Extensions::Logging::LogLevel minLevel);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory, Microsoft.Extensions.Logging.LogLevel minLevel);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Extensions.Logging.LogLevel -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory, minLevel As LogLevel) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

minLevel
LogLevel

The minimum LogLevel to be logged

Returns

Attributes

AddConsole(ILoggerFactory, Boolean)

Warning

This API is now obsolete.

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, bool includeScopes);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory, bool includeScopes);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory * bool -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory, includeScopes As Boolean) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

includeScopes
Boolean

A value which indicates whether log scope information should be displayed in the output.

Returns

Attributes

AddConsole(ILoggerFactory, Func<String,LogLevel,Boolean>)

Warning

This API is now obsolete.

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, Func<System::String ^, Microsoft::Extensions::Logging::LogLevel, bool> ^ filter);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory, Func<string,Microsoft.Extensions.Logging.LogLevel,bool> filter);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory * Func<string, Microsoft.Extensions.Logging.LogLevel, bool> -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory, filter As Func(Of String, LogLevel, Boolean)) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

filter
Func<String,LogLevel,Boolean>

The category filter to apply to logs.

Returns

Attributes

AddConsole(ILoggingBuilder, Action<ConsoleLoggerOptions>)

Adds a console logger named 'Console' to the factory.

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

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to use.

configure
Action<ConsoleLoggerOptions>

A delegate to configure the ConsoleLogger.

Returns

AddConsole(ILoggerFactory, LogLevel, Boolean)

Warning

This API is now obsolete.

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, Microsoft::Extensions::Logging::LogLevel minLevel, bool includeScopes);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory, Microsoft.Extensions.Logging.LogLevel minLevel, bool includeScopes);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory * Microsoft.Extensions.Logging.LogLevel * bool -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory, minLevel As LogLevel, includeScopes As Boolean) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

minLevel
LogLevel

The minimum LogLevel to be logged

includeScopes
Boolean

A value which indicates whether log scope information should be displayed in the output.

Returns

Attributes

AddConsole(ILoggerFactory, Func<String,LogLevel,Boolean>, Boolean)

Warning

This API is now obsolete.

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

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddConsole(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, Func<System::String ^, Microsoft::Extensions::Logging::LogLevel, bool> ^ filter, bool includeScopes);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddConsole(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddConsole (this Microsoft.Extensions.Logging.ILoggerFactory factory, Func<string,Microsoft.Extensions.Logging.LogLevel,bool> filter, bool includeScopes);
static member AddConsole : Microsoft.Extensions.Logging.ILoggerFactory * Func<string, Microsoft.Extensions.Logging.LogLevel, bool> * bool -> Microsoft.Extensions.Logging.ILoggerFactory
<Extension()>
Public Function AddConsole (factory As ILoggerFactory, filter As Func(Of String, LogLevel, Boolean), includeScopes As Boolean) As ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

filter
Func<String,LogLevel,Boolean>

The category filter to apply to logs.

includeScopes
Boolean

A value which indicates whether log scope information should be displayed in the output.

Returns

Attributes

Applies to