[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.
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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eErrorReportingExceptionLoggerExtension\u003c/code\u003e class provides middleware for reporting uncaught exceptions to the Google Cloud Error Reporting API.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eAddGoogleExceptionLogging\u003c/code\u003e method adds services to report uncaught exceptions, and is used for Google App Engine or Google Compute Engine.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eUseGoogleExceptionLogging\u003c/code\u003e method is a middleware to report uncaught exceptions to the Google Cloud Error Reporting API.\u003c/p\u003e\n"],["\u003cp\u003eThe middleware should be the first one used to ensure all unhandled exceptions are reported.\u003c/p\u003e\n"],["\u003cp\u003eBoth \u003ccode\u003eAddGoogleExceptionLogging\u003c/code\u003e and \u003ccode\u003eUseGoogleExceptionLogging\u003c/code\u003e are now obsolete, and should be replaced by \u003ccode\u003eGoogle.Cloud.Diagnostics.AspNetCore.AspNetCoreErrorReportingExtensions.AddGoogleErrorReportingForAspNetCore\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class ErrorReportingExceptionLoggerExtension (4.4.0)\n\nVersion latestkeyboard_arrow_down\n\n- [4.4.0 (latest)](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore.ErrorReportingExceptionLoggerExtension)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/4.3.1/Google.Cloud.Diagnostics.AspNetCore.ErrorReportingExceptionLoggerExtension) \n\n [Obsolete(\"Use Google.Cloud.Diagnostics.AspNetCore.AspNetCoreErrorReportingExtensions instead.\")]\n public static class ErrorReportingExceptionLoggerExtension\n\nUses the Google Cloud Error Reporting Exception Logger Middleware.\nTo ensure all unhandled exceptions are reported, this should be\nthe first piece of middleware used. \n\nInheritance\n-----------\n\n[Object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e ErrorReportingExceptionLoggerExtension \n\nInherited Members\n-----------------\n\n[Object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode#system-object-gethashcode) \n[Object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype#system-object-gettype) \n[Object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone#system-object-memberwiseclone) \n[Object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring#system-object-tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Diagnostics.AspNetCore](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/latest/Google.Cloud.Diagnostics.AspNetCore)\n\nAssembly\n--------\n\nGoogle.Cloud.Diagnostics.AspNetCore.dll\n\nMethods\n-------\n\n### AddGoogleExceptionLogging(IServiceCollection, Action\\\u003cErrorReportingServiceOptions\\\u003e)\n\n [Obsolete(\"Use Google.Cloud.Diagnostics.AspNetCore.AspNetCoreErrorReportingExtensions.AddGoogleErrorReportingForAspNetCore instead.\")]\n public static IServiceCollection AddGoogleExceptionLogging(this IServiceCollection services, Action\u003cErrorReportingServiceOptions\u003e setupAction)\n\nAdds services for middleware that will report all uncaught exceptions to the\nGoogle Cloud Error Reporting API.\n\n\nCan be used when running on Google App Engine or Google Compute Engine.\nThe Google Cloud Platform project to report errors to will detected from the\ncurrent platform.\n\n\u003cbr /\u003e\n\n**Remarks** \nIf [ExceptionHandling](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.RetryOptions.html#Google_Cloud_Diagnostics_Common_RetryOptions_ExceptionHandling) is set to [Propagate](https://cloud.google.com/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.ExceptionHandling.html#Google_Cloud_Diagnostics_Common_ExceptionHandling_Propagate)\nand the [RequestDelegate](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.requestdelegate) executed by this middleware throws an exception and this\ndiagnostics library also throws an exception trying to report it an [AggregateException](https://learn.microsoft.com/dotnet/api/system.aggregateexception)\nwith both exceptions will be thrown. Otherwise only the exception from the [RequestDelegate](https://learn.microsoft.com/dotnet/api/microsoft.aspnetcore.http.requestdelegate)\nwill be thrown.\n\n### UseGoogleExceptionLogging(IApplicationBuilder)\n\n [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.\")]\n public static IApplicationBuilder UseGoogleExceptionLogging(this IApplicationBuilder app)\n\nUses middleware that will report all uncaught exceptions to the Google Cloud\nError Reporting API."]]