【发布时间】:2014-06-08 08:35:55
【问题描述】:
我的 Windows Azure Web 角色 ASP.NET MVC 应用程序在某些路由上提供 REST API 请求,而这些路由需要“基本”身份验证。客户端程序经常无法进行身份验证——它们中的大多数都在被调试的过程中——因此身份验证失败是很常见的。对于每个事件,我都会在 Application 日志中获得这样的记录(可通过事件查看器或 System.Diagnostics.EventLog 类访问)
Date and Time Here (ASP.NET 4.0.30319.0): Event code: 100001
Event message: Authentication failure
Event time: Date and time
Event time (UTC): UTC date and time
// lots of information follows
我确信我永远不会读取这些消息,并且写入它们会消耗服务 VM 上的一些 CPU 时间和 IO 带宽。
如何让那些失败不被记录?
【问题讨论】:
-
你在哪里看到的?在 Windows 事件查看器中?存储中的 Azure 诊断日志?
-
@haim770:在事件查看器 Application 日志中。
-
@haim770:我尝试将 web.config 中的
errorsToNTLog设置为“false”(根据 MSDN,这是默认值,但无论如何),行为是相同的。
标签: asp.net asp.net-mvc azure error-handling event-log