Interface IExceptionLogger (4.4.0)

public interface IExceptionLogger

A generic exception logger.

Namespace

Google.Cloud.Diagnostics.AspNetCore

Assembly

Google.Cloud.Diagnostics.AspNetCore.dll

Methods

Log(Exception, HttpContext)

void Log(Exception exception, HttpContext context = null)

Logs an exception that occurred.

Parameters
Name Description
exception System.Exception

The exception to log. Must not be null.

context Microsoft.AspNetCore.Http.HttpContext

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

The exception to log. Must not be null.

context Microsoft.AspNetCore.Http.HttpContext

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

cancellationToken System.Threading.CancellationToken

Optional, The token to monitor for cancellation requests.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.