Interface IContextExceptionLogger (4.3.1)

public interface IContextExceptionLogger : IDisposable

A generic exception logger for IContextWrappers.

Namespace

Google.Cloud.Diagnostics.Common

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(CancellationToken))

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.