共用方式為


LogHelper.LogException Method

Definition

Overloads

LogException<T>(EventLevel, Exception, String, Object[])

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(Exception, String, Object[])

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(EventLevel, String, Object[])

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(EventLevel, Exception, String)

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(Exception, String)

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(EventLevel, String)

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(String)

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(String, Object[])

Logs an exception using the event source logger and returns new typed exception.

LogException<T>(EventLevel, Exception, String, Object[])

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (System.Diagnostics.Tracing.EventLevel eventLevel, Exception innerException, string format, params object[] args) where T : Exception;
static member LogException : System.Diagnostics.Tracing.EventLevel * Exception * string * obj[] -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (eventLevel As EventLevel, innerException As Exception, format As String, ParamArray args As Object()) As T

Type Parameters

T

Parameters

eventLevel
EventLevel

Identifies the level of an event to be logged.

innerException
Exception

the inner Exception to be added to the outer exception.

format
String

Format string of the log message.

args
Object[]

An object array that contains zero or more objects to format.

Returns

T

Applies to

LogException<T>(Exception, String, Object[])

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (Exception innerException, string format, params object[] args) where T : Exception;
static member LogException : Exception * string * obj[] -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (innerException As Exception, format As String, ParamArray args As Object()) As T

Type Parameters

T

Parameters

innerException
Exception

the inner Exception to be added to the outer exception.

format
String

Format string of the log message.

args
Object[]

An object array that contains zero or more objects to format.

Returns

T

Remarks

EventLevel is set to Error.

Applies to

LogException<T>(EventLevel, String, Object[])

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (System.Diagnostics.Tracing.EventLevel eventLevel, string format, params object[] args) where T : Exception;
static member LogException : System.Diagnostics.Tracing.EventLevel * string * obj[] -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (eventLevel As EventLevel, format As String, ParamArray args As Object()) As T

Type Parameters

T

Parameters

eventLevel
EventLevel

Identifies the level of an event to be logged.

format
String

Format string of the log message.

args
Object[]

An object array that contains zero or more objects to format.

Returns

T

Applies to

LogException<T>(EventLevel, Exception, String)

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (System.Diagnostics.Tracing.EventLevel eventLevel, Exception innerException, string message) where T : Exception;
static member LogException : System.Diagnostics.Tracing.EventLevel * Exception * string -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (eventLevel As EventLevel, innerException As Exception, message As String) As T

Type Parameters

T

Parameters

eventLevel
EventLevel

Identifies the level of an event to be logged.

innerException
Exception

the inner Exception to be added to the outer exception.

message
String

message to log.

Returns

T

Applies to

LogException<T>(Exception, String)

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (Exception innerException, string message) where T : Exception;
static member LogException : Exception * string -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (innerException As Exception, message As String) As T

Type Parameters

T

Parameters

innerException
Exception

the inner Exception to be added to the outer exception.

message
String

message to log.

Returns

T

Remarks

EventLevel is set to Error.

Applies to

LogException<T>(EventLevel, String)

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (System.Diagnostics.Tracing.EventLevel eventLevel, string message) where T : Exception;
static member LogException : System.Diagnostics.Tracing.EventLevel * string -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (eventLevel As EventLevel, message As String) As T

Type Parameters

T

Parameters

eventLevel
EventLevel

Identifies the level of an event to be logged.

message
String

message to log.

Returns

T

Applies to

LogException<T>(String)

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (string message) where T : Exception;
static member LogException : string -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (message As String) As T

Type Parameters

T

Parameters

message
String

message to log.

Returns

T

Remarks

EventLevel is set to Error.

Applies to

LogException<T>(String, Object[])

Logs an exception using the event source logger and returns new typed exception.

public static T LogException<T> (string format, params object[] args) where T : Exception;
static member LogException : string * obj[] -> 'T (requires 'T :> Exception)
Public Shared Function LogException(Of T As Exception) (format As String, ParamArray args As Object()) As T

Type Parameters

T

Parameters

format
String

Format string of the log message.

args
Object[]

An object array that contains zero or more objects to format.

Returns

T

Remarks

EventLevel is set to Error.

Applies to