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

LoggerMessageAttribute

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

Gets or sets 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 or sets the logging level for the logging method.

public string Message { get; set; }

Gets or sets the message text for the logging method.

public bool SkipEnabledCheck { get; set; }

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

Initializes a new instance of the LoggerMessageAttribute class that's 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 that's 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 that's used to guide the production of a strongly typed logging method.

Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method.

public LoggerMessageAttribute(string message)

Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method.