Class ErrorReportingExceptionLoggerExtension (4.3.1)

[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore.AspNetCoreErrorReportingExtensions instead.")]
public static class ErrorReportingExceptionLoggerExtension

Uses the Google Cloud Error Reporting Exception Logger Middleware. To ensure all unhandled exceptions are reported, this should be the first piece of middleware used.

Inheritance

Object > ErrorReportingExceptionLoggerExtension

Namespace

Google.Cloud.Diagnostics.AspNetCore

Assembly

Google.Cloud.Diagnostics.AspNetCore.dll

Methods

AddGoogleExceptionLogging(IServiceCollection, Action<ErrorReportingServiceOptions>)

[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore.AspNetCoreErrorReportingExtensions.AddGoogleErrorReportingForAspNetCore instead.")]
public static IServiceCollection AddGoogleExceptionLogging(this IServiceCollection services, Action<ErrorReportingServiceOptions> setupAction)

Adds services for middleware that will report all uncaught exceptions to the Google Cloud Error Reporting API.

Can be used when running on Google App Engine or Google Compute Engine. The Google Cloud Platform project to report errors to will detected from the current platform.

Parameters
NameDescription
servicesIServiceCollection

The service collection. Must not be null.

setupActionAction<ErrorReportingServiceOptions>

Action to set up options. Must not be null.

Returns
TypeDescription
IServiceCollection
Remarks

If ExceptionHandling is set to Propagate and the RequestDelegate executed by this middleware throws an exception and this diagnostics library also throws an exception trying to report it an AggregateException with both exceptions will be thrown. Otherwise only the exception from the RequestDelegate will be thrown.

UseGoogleExceptionLogging(IApplicationBuilder)

[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore.AspNetCoreErrorReportingExtensions.AddGoogleErrorReportingForAspNetCore for configuring Google Cloud Error Reporting in ASP.NET Core applications. There's no need to explicitly register the middleware.")]
public static IApplicationBuilder UseGoogleExceptionLogging(this IApplicationBuilder app)

Uses middleware that will report all uncaught exceptions to the Google Cloud Error Reporting API.

Parameter
NameDescription
appIApplicationBuilder

The application builder. Must not be null.

Returns
TypeDescription
IApplicationBuilder