[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.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.
Namespace
Google.Cloud.Diagnostics.AspNetCore3Assembly
Google.Cloud.Diagnostics.AspNetCore3.dll
Methods
AddGoogleExceptionLogging(IServiceCollection, Action<ErrorReportingServiceOptions>)
[Obsolete("Use Google.Cloud.Diagnostics.AspNetCore3.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 | |
---|---|
Name | Description |
services | IServiceCollection The service collection. Must not be null. |
setupAction | Action<ErrorReportingServiceOptions> Action to set up options. Must not be null. |
Returns | |
---|---|
Type | Description |
IServiceCollection |
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.AspNetCore3.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 | |
---|---|
Name | Description |
app | IApplicationBuilder The application builder. Must not be null. |
Returns | |
---|---|
Type | Description |
IApplicationBuilder |