Google.Cloud.Diagnostics.Common - Interface IContextExceptionLogger (5.1.0)

public interface IContextExceptionLogger : IDisposable

Reference documentation and code samples for the Google.Cloud.Diagnostics.Common interface IContextExceptionLogger.

A generic exception logger for IContextWrappers.

Namespace

GoogleCloudGoogle.Cloud.DiagnosticsCommon

Assembly

Google.Cloud.Diagnostics.Common.dll

Methods

Log(Exception, IContextWrapper)

void Log(Exception exception, IContextWrapper context)

Logs an exception that occurred.

Parameters
NameDescription
exceptionException

The exception to log. Must not be null.

contextIContextWrapper

The current context. Must not be null.

LogAsync(Exception, IContextWrapper, CancellationToken)

Task LogAsync(Exception exception, IContextWrapper context, CancellationToken cancellationToken = default)

Asynchronously logs an exception that occurred.

Parameters
NameDescription
exceptionException

The exception to log. Must not be null.

contextIContextWrapper

The current context. Must not be null.

cancellationTokenCancellationToken

Optional, The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.