[[["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\u003eThis page describes the \u003ccode\u003eIExceptionLogger\u003c/code\u003e interface, a generic tool for logging exceptions in .NET applications within the Google Cloud Diagnostics framework.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLog\u003c/code\u003e method allows synchronous logging of an exception, taking the exception itself and an optional \u003ccode\u003eHttpContext\u003c/code\u003e as parameters.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eLogAsync\u003c/code\u003e method provides asynchronous logging capabilities, including parameters for the exception, \u003ccode\u003eHttpContext\u003c/code\u003e (optional), and a \u003ccode\u003eCancellationToken\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe logger automatically retrieves the current HTTP context if an explicit one is not provided.\u003c/p\u003e\n"]]],[],null,["# Interface IExceptionLogger (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.IExceptionLogger)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.AspNetCore/4.3.1/Google.Cloud.Diagnostics.AspNetCore.IExceptionLogger) \n\n public interface IExceptionLogger\n\nA generic exception logger.\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### Log(Exception, HttpContext)\n\n void Log(Exception exception, HttpContext context = null)\n\nLogs an exception that occurred.\n\n### LogAsync(Exception, HttpContext, CancellationToken)\n\n Task LogAsync(Exception exception, HttpContext context = null, CancellationToken cancellationToken = default(CancellationToken))\n\nAsynchronously logs an exception that occurred."]]