LoggerMessageAttribute Constructors
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
LoggerMessageAttribute() |
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method. |
LoggerMessageAttribute(LogLevel) |
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method. |
LoggerMessageAttribute(String) |
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method. |
LoggerMessageAttribute(LogLevel, String) |
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method. |
LoggerMessageAttribute(Int32, LogLevel, String) |
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method. |
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method.
public:
LoggerMessageAttribute();
public LoggerMessageAttribute();
Public Sub New ()
Applies to
.NET 10 (package-provided) 及其他版本
產品 | 版本 |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method.
public:
LoggerMessageAttribute(Microsoft::Extensions::Logging::LogLevel level);
public LoggerMessageAttribute(Microsoft.Extensions.Logging.LogLevel level);
new Microsoft.Extensions.Logging.LoggerMessageAttribute : Microsoft.Extensions.Logging.LogLevel -> Microsoft.Extensions.Logging.LoggerMessageAttribute
Public Sub New (level As LogLevel)
Parameters
- level
- LogLevel
The log level.
Applies to
.NET 10 (package-provided) 及其他版本
產品 | 版本 |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method.
public:
LoggerMessageAttribute(System::String ^ message);
public LoggerMessageAttribute(string message);
new Microsoft.Extensions.Logging.LoggerMessageAttribute : string -> Microsoft.Extensions.Logging.LoggerMessageAttribute
Public Sub New (message As String)
Parameters
- message
- String
Format string of the log message.
Applies to
.NET 10 (package-provided) 及其他版本
產品 | 版本 |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
Initializes a new instance of the LoggerMessageAttribute class that's used to guide the production of a strongly typed logging method.
public:
LoggerMessageAttribute(Microsoft::Extensions::Logging::LogLevel level, System::String ^ message);
public LoggerMessageAttribute(Microsoft.Extensions.Logging.LogLevel level, string message);
new Microsoft.Extensions.Logging.LoggerMessageAttribute : Microsoft.Extensions.Logging.LogLevel * string -> Microsoft.Extensions.Logging.LoggerMessageAttribute
Public Sub New (level As LogLevel, message As String)
Parameters
- level
- LogLevel
The log level.
- message
- String
Format string of the log message.
Applies to
.NET 10 (package-provided) 及其他版本
產品 | 版本 |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
- Source:
- LoggerMessageAttribute.cs
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, Microsoft::Extensions::Logging::LogLevel level, System::String ^ message);
public LoggerMessageAttribute(int eventId, Microsoft.Extensions.Logging.LogLevel level, string message);
new Microsoft.Extensions.Logging.LoggerMessageAttribute : int * Microsoft.Extensions.Logging.LogLevel * string -> Microsoft.Extensions.Logging.LoggerMessageAttribute
Public Sub New (eventId As Integer, level As LogLevel, message As String)
Parameters
- eventId
- Int32
The log event ID.
- level
- LogLevel
The log level.
- message
- String
Format string of the log message.
Applies to
.NET 10 (package-provided) 及其他版本
產品 | 版本 |
---|---|
.NET | 8 (package-provided), 9 (package-provided), 10 (package-provided) |
.NET Standard | 2.0 (package-provided) |