How To Disable .NET Event Log Warnings?

前端 未结 2 599
北恋
北恋 2020-12-19 11:17

Per our policy we are no longer allowed to write to event log, so I removed all my event log code from writing to the event log, which works, however I keep getting random A

2条回答
  •  盖世英雄少女心
    2020-12-19 12:11

    The default behavior of ASP.NET is to write unhandled exceptions to the event log. The way to prevent it from writing them to the event log is to handle them yourself. You can do this via your Global.asax file in the Application_OnError handler.

    You can also call Server.ClearError() to prevent it from bubbling up to any other handlers.

提交回复
热议问题