azure - 捕获所有异常

标签 azure asp.net-core .net-core azure-functions

是否可以在一处捕获所有 Azure Function 异常,就像 ASP.NET 的 global.asax 中的 IExceptionFilterApplication_Error 一样?

另外,是否可以抓取当前的HttpRequestMessage来获取异常的上下文?

最佳答案

您可以使用Function Filters为了那个原因;但是,它们仅适用于使用属性模型的预编译函数,请参阅 this了解更多信息

关于azure - 捕获所有异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46728172/

相关文章:

c# - 依赖注入(inject) : HttpClient or HttpClientFactory?

c# - 从 .Net Core 运行 Powershell - 无法加载文件或程序集 Microsoft.Management.Infrastruct

python - 在 Microsoft Azure WebJob 中指定 Python 版本?

c# - 通过代理使用 KeyVaultClient

c# - 如何在本地创建 IConfiguration 实例?

.net-core - dotnet 核心 2.1 : "Found conflicts between different versions of" when referencing a web project from an xunit project

azure - 为什么在部署 Blazor 服务器端应用程序时建议使用 Azure SignalR 服务?

azure - 确定 Azure Log Analytics 工作区上设置的保留期

c# - Enum<T>.Parse 允许解析任何整数字符串。这是 .net core 中的错误吗?