EventLoggerFactoryExtensions.AddEventLog Method

Definition

Overloads

AddEventLog(ILoggingBuilder)

Adds an event logger named 'EventLog' to the factory.

AddEventLog(ILoggingBuilder, EventLogSettings)

Adds an event logger. Use settings to enable logging for specific log levels.

AddEventLog(ILoggingBuilder, Action<EventLogSettings>)

Adds an event logger. Use configure to enable logging for specific log levels.

AddEventLog(ILoggingBuilder)

Source:
EventLoggerFactoryExtensions.cs
Source:
EventLoggerFactoryExtensions.cs
Source:
EventLoggerFactoryExtensions.cs

Adds an event logger named 'EventLog' to the factory.

C#
public static Microsoft.Extensions.Logging.ILoggingBuilder AddEventLog (this Microsoft.Extensions.Logging.ILoggingBuilder builder);

Parameters

builder
ILoggingBuilder

The extension method argument.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) og andre versjoner
Produkt Versjoner
.NET 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)

AddEventLog(ILoggingBuilder, EventLogSettings)

Source:
EventLoggerFactoryExtensions.cs
Source:
EventLoggerFactoryExtensions.cs
Source:
EventLoggerFactoryExtensions.cs

Adds an event logger. Use settings to enable logging for specific log levels.

C#
public static Microsoft.Extensions.Logging.ILoggingBuilder AddEventLog (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Microsoft.Extensions.Logging.EventLog.EventLogSettings settings);

Parameters

builder
ILoggingBuilder

The extension method argument.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) og andre versjoner
Produkt Versjoner
.NET 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)

AddEventLog(ILoggingBuilder, Action<EventLogSettings>)

Source:
EventLoggerFactoryExtensions.cs
Source:
EventLoggerFactoryExtensions.cs
Source:
EventLoggerFactoryExtensions.cs

Adds an event logger. Use configure to enable logging for specific log levels.

C#
public static Microsoft.Extensions.Logging.ILoggingBuilder AddEventLog (this Microsoft.Extensions.Logging.ILoggingBuilder builder, Action<Microsoft.Extensions.Logging.EventLog.EventLogSettings> configure);

Parameters

builder
ILoggingBuilder

The extension method argument.

configure
Action<EventLogSettings>

A delegate to configure the EventLogSettings.

Returns

The ILoggingBuilder so that additional calls can be chained.

Applies to

.NET 9 (package-provided) og andre versjoner
Produkt Versjoner
.NET 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)