LoggerExtensions.LogCritical 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
LogCritical(ILogger, String, Object[]) |
设置关键日志消息格式并写入该消息。 |
LogCritical(ILogger, EventId, String, Object[]) |
设置关键日志消息格式并写入该消息。 |
LogCritical(ILogger, Exception, String, Object[]) |
设置关键日志消息格式并写入该消息。 |
LogCritical(ILogger, EventId, Exception, String, Object[]) |
设置关键日志消息格式并写入该消息。 |
LogCritical(ILogger, String, Object[])
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
设置关键日志消息格式并写入该消息。
public:
[System::Runtime::CompilerServices::Extension]
static void LogCritical(Microsoft::Extensions::Logging::ILogger ^ logger, System::String ^ message, ... cli::array <System::Object ^> ^ args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, string message, params object[] args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, string? message, params object?[] args);
static member LogCritical : Microsoft.Extensions.Logging.ILogger * string * obj[] -> unit
<Extension()>
Public Sub LogCritical (logger As ILogger, message As String, ParamArray args As Object())
参数
- message
- String
采用消息模板格式的日志消息的格式字符串。 示例: "User {User} logged in from {Address}"
- args
- Object[]
一个对象数组,其中包含零个或多个要设置格式的对象。
示例
logger.LogCritical("Processing request from {Address}", address)
适用于
LogCritical(ILogger, EventId, String, Object[])
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
设置关键日志消息格式并写入该消息。
public:
[System::Runtime::CompilerServices::Extension]
static void LogCritical(Microsoft::Extensions::Logging::ILogger ^ logger, Microsoft::Extensions::Logging::EventId eventId, System::String ^ message, ... cli::array <System::Object ^> ^ args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, Microsoft.Extensions.Logging.EventId eventId, string message, params object[] args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, Microsoft.Extensions.Logging.EventId eventId, string? message, params object?[] args);
static member LogCritical : Microsoft.Extensions.Logging.ILogger * Microsoft.Extensions.Logging.EventId * string * obj[] -> unit
<Extension()>
Public Sub LogCritical (logger As ILogger, eventId As EventId, message As String, ParamArray args As Object())
参数
- eventId
- EventId
与日志关联的事件 ID。
- message
- String
采用消息模板格式的日志消息的格式字符串。 示例: "User {User} logged in from {Address}"
- args
- Object[]
一个对象数组,其中包含零个或多个要设置格式的对象。
示例
logger.LogCritical(0, "Processing request from {Address}", address)
适用于
LogCritical(ILogger, Exception, String, Object[])
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
设置关键日志消息格式并写入该消息。
public:
[System::Runtime::CompilerServices::Extension]
static void LogCritical(Microsoft::Extensions::Logging::ILogger ^ logger, Exception ^ exception, System::String ^ message, ... cli::array <System::Object ^> ^ args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, Exception exception, string message, params object[] args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, Exception? exception, string? message, params object?[] args);
static member LogCritical : Microsoft.Extensions.Logging.ILogger * Exception * string * obj[] -> unit
<Extension()>
Public Sub LogCritical (logger As ILogger, exception As Exception, message As String, ParamArray args As Object())
参数
- exception
- Exception
要记录的异常。
- message
- String
采用消息模板格式的日志消息的格式字符串。 示例: "User {User} logged in from {Address}"
- args
- Object[]
一个对象数组,其中包含零个或多个要设置格式的对象。
示例
logger.LogCritical(exception, "Error while processing request from {Address}", address)
适用于
LogCritical(ILogger, EventId, Exception, String, Object[])
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
- Source:
- LoggerExtensions.cs
设置关键日志消息格式并写入该消息。
public:
[System::Runtime::CompilerServices::Extension]
static void LogCritical(Microsoft::Extensions::Logging::ILogger ^ logger, Microsoft::Extensions::Logging::EventId eventId, Exception ^ exception, System::String ^ message, ... cli::array <System::Object ^> ^ args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, Microsoft.Extensions.Logging.EventId eventId, Exception exception, string message, params object[] args);
public static void LogCritical (this Microsoft.Extensions.Logging.ILogger logger, Microsoft.Extensions.Logging.EventId eventId, Exception? exception, string? message, params object?[] args);
static member LogCritical : Microsoft.Extensions.Logging.ILogger * Microsoft.Extensions.Logging.EventId * Exception * string * obj[] -> unit
<Extension()>
Public Sub LogCritical (logger As ILogger, eventId As EventId, exception As Exception, message As String, ParamArray args As Object())
参数
- eventId
- EventId
与日志关联的事件 ID。
- exception
- Exception
要记录的异常。
- message
- String
采用消息模板格式的日志消息的格式字符串。 示例: "User {User} logged in from {Address}"
- args
- Object[]
一个对象数组,其中包含零个或多个要设置格式的对象。
示例
logger.LogCritical(0, exception, "Error while processing request from {Address}", address)