Show / Hide Table of Contents

Interface IWebApiExceptionLogger

An exception logger for use from withing a Web Api application.

Namespace: Google.Cloud.Diagnostics.AspNet
Assembly: Google.Cloud.Diagnostics.AspNet.dll
Syntax
public interface IWebApiExceptionLogger

Methods

Log(Exception, HttpActionContext)

Logs an exception that occurred.

Declaration
void Log(Exception exception, HttpActionContext context = null)
Parameters
Type Name Description
System.Exception exception

The exception to log. Must not be null.

System.Web.Http.Controllers.HttpActionContext context

Optional, the current HTTP action context from which to get HTTP context information. If it is not set, no HTTP context information will be logged alongside exception information.

LogAsync(Exception, HttpActionContext, CancellationToken)

Asynchronously logs an exception that occurred.

Declaration
Task LogAsync(Exception exception, HttpActionContext context = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type Name Description
System.Exception exception

The exception to log. Must not be null.

System.Web.Http.Controllers.HttpActionContext context

Optional, the current HTTP action context from which to get HTTP context information. If it is not set, no HTTP context information will be logged alongside exception information.

System.Threading.CancellationToken cancellationToken

Optional, the token to monitor for cancellation requests.

Returns
Type Description
System.Threading.Tasks.Task

A task representing the asynchronous operation.

Back to top