TraceSourceFactoryExtensions.AddTraceSource Method

Definition

Overloads

AddTraceSource(ILoggerFactory, SourceSwitch)
AddTraceSource(ILoggerFactory, String)
AddTraceSource(ILoggingBuilder, SourceSwitch)

Adds a TraceSource logger named 'TraceSource' to the factory.

AddTraceSource(ILoggingBuilder, String)

Adds a TraceSource logger named 'TraceSource' to the factory.

AddTraceSource(ILoggerFactory, SourceSwitch, TraceListener)
AddTraceSource(ILoggerFactory, String, TraceListener)
AddTraceSource(ILoggingBuilder, SourceSwitch, TraceListener)

Adds a TraceSource logger named 'TraceSource' to the factory.

AddTraceSource(ILoggingBuilder, String, TraceListener)

Adds a TraceSource logger named 'TraceSource' to the factory.

AddTraceSource(ILoggerFactory, SourceSwitch)

Warning

This API is now obsolete.

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

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

sourceSwitch
SourceSwitch

The SourceSwitch to use.

Returns

Attributes

AddTraceSource(ILoggerFactory, String)

Warning

This API is now obsolete.

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

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

switchName
String

The name of the SourceSwitch to use.

Returns

Attributes

AddTraceSource(ILoggingBuilder, SourceSwitch)

Adds a TraceSource logger named 'TraceSource' to the factory.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddTraceSource(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder, System::Diagnostics::SourceSwitch ^ sourceSwitch);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddTraceSource (this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Diagnostics.SourceSwitch sourceSwitch);
static member AddTraceSource : Microsoft.Extensions.Logging.ILoggingBuilder * System.Diagnostics.SourceSwitch -> Microsoft.Extensions.Logging.ILoggingBuilder

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to use.

sourceSwitch
SourceSwitch

The SourceSwitch to use.

Returns

The ILoggingBuilder so that additional calls can be chained.

AddTraceSource(ILoggingBuilder, String)

Adds a TraceSource logger named 'TraceSource' to the factory.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddTraceSource(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder, System::String ^ switchName);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddTraceSource (this Microsoft.Extensions.Logging.ILoggingBuilder builder, string switchName);
static member AddTraceSource : Microsoft.Extensions.Logging.ILoggingBuilder * string -> Microsoft.Extensions.Logging.ILoggingBuilder
<Extension()>
Public Function AddTraceSource (builder As ILoggingBuilder, switchName As String) As ILoggingBuilder

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to use.

switchName
String

The name of the SourceSwitch to use.

Returns

The ILoggingBuilder so that additional calls can be chained.

AddTraceSource(ILoggerFactory, SourceSwitch, TraceListener)

Warning

This API is now obsolete.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggerFactory ^ AddTraceSource(Microsoft::Extensions::Logging::ILoggerFactory ^ factory, System::Diagnostics::SourceSwitch ^ sourceSwitch, System::Diagnostics::TraceListener ^ listener);
[System.Obsolete("This method is obsolete and will be removed in a future version. The recommended alternative is AddTraceSource(this ILoggingBuilder builder).")]
public static Microsoft.Extensions.Logging.ILoggerFactory AddTraceSource (this Microsoft.Extensions.Logging.ILoggerFactory factory, System.Diagnostics.SourceSwitch sourceSwitch, System.Diagnostics.TraceListener listener);
static member AddTraceSource : Microsoft.Extensions.Logging.ILoggerFactory * System.Diagnostics.SourceSwitch * System.Diagnostics.TraceListener -> Microsoft.Extensions.Logging.ILoggerFactory

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

sourceSwitch
SourceSwitch

The SourceSwitch to use.

listener
TraceListener

The TraceListener to use.

Returns

Attributes

AddTraceSource(ILoggerFactory, String, TraceListener)

Warning

This API is now obsolete.

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

Parameters

factory
ILoggerFactory

The ILoggerFactory to use.

switchName
String

The name of the SourceSwitch to use.

listener
TraceListener

The TraceListener to use.

Returns

Attributes

AddTraceSource(ILoggingBuilder, SourceSwitch, TraceListener)

Adds a TraceSource logger named 'TraceSource' to the factory.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddTraceSource(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder, System::Diagnostics::SourceSwitch ^ sourceSwitch, System::Diagnostics::TraceListener ^ listener);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddTraceSource (this Microsoft.Extensions.Logging.ILoggingBuilder builder, System.Diagnostics.SourceSwitch sourceSwitch, System.Diagnostics.TraceListener listener);
static member AddTraceSource : Microsoft.Extensions.Logging.ILoggingBuilder * System.Diagnostics.SourceSwitch * System.Diagnostics.TraceListener -> Microsoft.Extensions.Logging.ILoggingBuilder

Parameters

builder
ILoggingBuilder

The LoggerFactory to use.

sourceSwitch
SourceSwitch

The SourceSwitch to use.

listener
TraceListener

The TraceListener to use.

Returns

The ILoggingBuilder so that additional calls can be chained.

AddTraceSource(ILoggingBuilder, String, TraceListener)

Adds a TraceSource logger named 'TraceSource' to the factory.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Logging::ILoggingBuilder ^ AddTraceSource(Microsoft::Extensions::Logging::ILoggingBuilder ^ builder, System::String ^ switchName, System::Diagnostics::TraceListener ^ listener);
public static Microsoft.Extensions.Logging.ILoggingBuilder AddTraceSource (this Microsoft.Extensions.Logging.ILoggingBuilder builder, string switchName, System.Diagnostics.TraceListener listener);
static member AddTraceSource : Microsoft.Extensions.Logging.ILoggingBuilder * string * System.Diagnostics.TraceListener -> Microsoft.Extensions.Logging.ILoggingBuilder
<Extension()>
Public Function AddTraceSource (builder As ILoggingBuilder, switchName As String, listener As TraceListener) As ILoggingBuilder

Parameters

builder
ILoggingBuilder

The ILoggingBuilder to use.

switchName
String

The name of the SourceSwitch to use.

listener
TraceListener

The TraceListener to use.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to