Bagikan melalui


TaskLoggingHelper.LogErrorFromException Method

Definition

Logs an error using the message from the specified exception.

Overloads

LogErrorFromException(Exception)

Logs an error using the message from the given exception context. No callstack will be shown. Thread safe.

LogErrorFromException(Exception, Boolean)

Logs an error using the message (and optionally the stack-trace) from the given exception context. Thread safe.

LogErrorFromException(Exception, Boolean, Boolean, String)

Logs an error using the message, and optionally the stack-trace from the given exception, and optionally inner exceptions too. Thread safe.

LogErrorFromException(Exception)

Source:
TaskLoggingHelper.cs

Logs an error using the message from the given exception context. No callstack will be shown. Thread safe.

public:
 void LogErrorFromException(Exception ^ exception);
public void LogErrorFromException (Exception exception);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void LogErrorFromException (Exception exception);
member this.LogErrorFromException : Exception -> unit
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LogErrorFromException : Exception -> unit
Public Sub LogErrorFromException (exception As Exception)

Parameters

exception
Exception

Exception to log.

Attributes

Exceptions

Thrown when e is null.

Remarks

No call stack will be shown.

Applies to

LogErrorFromException(Exception, Boolean)

Source:
TaskLoggingHelper.cs

Logs an error using the message (and optionally the stack-trace) from the given exception context. Thread safe.

public:
 void LogErrorFromException(Exception ^ exception, bool showStackTrace);
public void LogErrorFromException (Exception exception, bool showStackTrace);
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void LogErrorFromException (Exception exception, bool showStackTrace);
member this.LogErrorFromException : Exception * bool -> unit
[<System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]
member this.LogErrorFromException : Exception * bool -> unit
Public Sub LogErrorFromException (exception As Exception, showStackTrace As Boolean)

Parameters

exception
Exception

Exception to log.

showStackTrace
Boolean

If true, callstack will be appended to message.

Attributes

Exceptions

Thrown when exception is null.

Remarks

This method is not thread-safe.

Applies to

LogErrorFromException(Exception, Boolean, Boolean, String)

Source:
TaskLoggingHelper.cs

Logs an error using the message, and optionally the stack-trace from the given exception, and optionally inner exceptions too. Thread safe.

public:
 void LogErrorFromException(Exception ^ exception, bool showStackTrace, bool showDetail, System::String ^ file);
public void LogErrorFromException (Exception exception, bool showStackTrace, bool showDetail, string file);
member this.LogErrorFromException : Exception * bool * bool * string -> unit
Public Sub LogErrorFromException (exception As Exception, showStackTrace As Boolean, showDetail As Boolean, file As String)

Parameters

exception
Exception

Exception to log.

showStackTrace
Boolean

If true, callstack will be appended to message.

showDetail
Boolean

Whether to log exception types and any inner exceptions.

file
String

File related to the exception, or null if the project file should be logged

Exceptions

Thrown when exception is null.

Applies to