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
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.
It's true that the default behavior is to log all unhandled exceptions to Application event log as explained in this answer. This behavior is controlled by <system.web><healthMonitoring>
element in web.config
and default settings are shown here. The idea is that for every unhandled exception an instance of System.Web.Management.WebBaseErrorEvent
is raised and then ASP.NET default settings cause it to be logged into Application event log.
You could handle all errors or you could change ASP.NET settings. Rules which cause these events to be logged can be changed using <system.web><healthMonitoring><rules>
. Since you say you're prohibited from writing into the event log I would guess your best bet is to just erase the default rules as explained here:
<healthMonitoring>
<rules>
<clear />
</rules>
</healthMonitoring>
which removes the two default rules each causing writes to event log.