[[["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 document provides reference documentation for the \u003ccode\u003eIContextExceptionLogger\u003c/code\u003e interface within the Google.Cloud.Diagnostics.Common namespace, which is used for logging exceptions in the context of \u003ccode\u003eIContextWrapper\u003c/code\u003e objects.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIContextExceptionLogger\u003c/code\u003e interface includes two methods: \u003ccode\u003eLog\u003c/code\u003e, which synchronously logs an exception, and \u003ccode\u003eLogAsync\u003c/code\u003e, which asynchronously logs an exception with an optional cancellation token.\u003c/p\u003e\n"],["\u003cp\u003eBoth the \u003ccode\u003eLog\u003c/code\u003e and \u003ccode\u003eLogAsync\u003c/code\u003e methods require an \u003ccode\u003eException\u003c/code\u003e object and an \u003ccode\u003eIContextWrapper\u003c/code\u003e object as parameters, ensuring exceptions are logged with relevant context.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of this interface available is 5.2.0, and documentation for older versions is also linked.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eIContextExceptionLogger\u003c/code\u003e interface inherits from \u003ccode\u003eIDisposable\u003c/code\u003e, providing a \u003ccode\u003eDispose()\u003c/code\u003e method for resource management.\u003c/p\u003e\n"]]],[],null,["# Google.Cloud.Diagnostics.Common - Interface IContextExceptionLogger (5.3.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.3.0 (latest)](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.IContextExceptionLogger)\n- [5.2.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.2.0/Google.Cloud.Diagnostics.Common.IContextExceptionLogger)\n- [5.1.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.1.0/Google.Cloud.Diagnostics.Common.IContextExceptionLogger)\n- [5.0.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/5.0.0/Google.Cloud.Diagnostics.Common.IContextExceptionLogger)\n- [4.4.0](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.4.0/Google.Cloud.Diagnostics.Common.IContextExceptionLogger)\n- [4.3.1](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/4.3.1/Google.Cloud.Diagnostics.Common.IContextExceptionLogger) \n\n public interface IContextExceptionLogger : IDisposable\n\nReference documentation and code samples for the Google.Cloud.Diagnostics.Common interface IContextExceptionLogger.\n\nA generic exception logger for [IContextWrapper](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common.IContextWrapper)s. \n\nInherited Members\n-----------------\n\n[IDisposable.Dispose()](https://learn.microsoft.com/dotnet/api/system.idisposable.dispose)\n\nNamespace\n---------\n\n[Google.Cloud.Diagnostics.Common](/dotnet/docs/reference/Google.Cloud.Diagnostics.Common/latest/Google.Cloud.Diagnostics.Common)\n\nAssembly\n--------\n\nGoogle.Cloud.Diagnostics.Common.dll\n\nMethods\n-------\n\n### Log(Exception, IContextWrapper)\n\n void Log(Exception exception, IContextWrapper context)\n\nLogs an exception that occurred.\n\n### LogAsync(Exception, IContextWrapper, CancellationToken)\n\n Task LogAsync(Exception exception, IContextWrapper context, CancellationToken cancellationToken = default)\n\nAsynchronously logs an exception that occurred."]]