Interface IExceptionLogger (5.0.0)

public interface IExceptionLogger

A generic exception logger.

Namespace

Google.Cloud.Diagnostics.AspNetCore3

Assembly

Google.Cloud.Diagnostics.AspNetCore3.dll

Methods

Log(Exception, HttpContext)

void Log(Exception exception, HttpContext context = null)

Logs an exception that occurred.

Parameters
NameDescription
exceptionException

The exception to log. Must not be null.

contextHttpContext

Optional, the current HTTP context. If unset the current context will be retrieved automatically.

LogAsync(Exception, HttpContext, CancellationToken)

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

Asynchronously logs an exception that occurred.

Parameters
NameDescription
exceptionException

The exception to log. Must not be null.

contextHttpContext

Optional, the current HTTP context. If unset the current context will be retrieved automatically.

cancellationTokenCancellationToken

Optional, The token to monitor for cancellation requests.

Returns
TypeDescription
Task

A task representing the asynchronous operation.