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.

C#
public void LogErrorFromException(Exception exception);
C#
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void LogErrorFromException(Exception exception);

Parameters

exception
Exception

Exception to log.

Attributes

Exceptions

Thrown when e is null.

Remarks

No call stack will be shown.

Applies to

MSBuild 17 i druge verzije
Proizvod Verzije
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

LogErrorFromException(Exception, Boolean)

Source:
TaskLoggingHelper.cs

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

C#
public void LogErrorFromException(Exception exception, bool showStackTrace);
C#
[System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]
public void LogErrorFromException(Exception exception, bool showStackTrace);

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

MSBuild 17 i druge verzije
Proizvod Verzije
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17

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.

C#
public void LogErrorFromException(Exception exception, bool showStackTrace, bool showDetail, string file);

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

MSBuild 17 i druge verzije
Proizvod Verzije
MSBuild 15, 16, 17
MSBuild (.NET Core) 15, 16, 17