<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="9.0.0-preview.6.24327.7" />

LoggerMessageAttribute

public sealed class LoggerMessageAttribute : Attribute
Provides information to guide the production of a strongly-typed logging method.
public int EventId { get; set; }

Gets the logging event id for the logging method.

public string EventName { get; set; }

Gets or sets the logging event name for the logging method.

public LogLevel Level { get; set; }

Gets the logging level for the logging method.

public string Message { get; set; }

Gets the message text for the logging method.

public bool SkipEnabledCheck { get; set; }

Gets or sets the flag to skip the IsEnabled check for the logging method.

Initializes a new instance of the LoggerMessageAttribute class which is used to guide the production of a strongly-typed logging method.

public LoggerMessageAttribute(int eventId, LogLevel level, string message)

Initializes a new instance of the LoggerMessageAttribute class, which is used to guide the production of a strongly typed logging method.

public LoggerMessageAttribute(LogLevel level, string message)

Initializes a new instance of the LoggerMessageAttribute class, which is used to guide the production of a strongly typed logging method.

Initializes a new instance of the LoggerMessageAttribute class, which is used to guide the production of a strongly typed logging method.

public LoggerMessageAttribute(string message)

Initializes a new instance of the LoggerMessageAttribute class, which is used to guide the production of a strongly typed logging method.