Google.Cloud.Diagnostics.Common - Interface IContextExceptionLogger (5.3.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

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
Name Description
exception Exception

The exception to log. Must not be null.

context IContextWrapper

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
Name Description
exception Exception

The exception to log. Must not be null.

context IContextWrapper

The current context. Must not be null.

cancellationToken CancellationToken

Optional, The token to monitor for cancellation requests.

Returns
Type Description
Task

A task representing the asynchronous operation.