How to disable .NET event log warnings?

In accordance with our policy, we are no longer allowed to write to the event log, so I deleted all the event log code from writing to the event log, which works, however, I continue to receive random ASP.NET 4.0 warnings from errors, even though I have the code in Application_Error to handle all errors.

Any way to completely disable event logging, maybe change web.config or the IIS option to disable it?

Noticing this for many errors too .. not just my HTTPHandler

Example EventLog entry:

Event code: 3005 
Event message: An unhandled exception has occurred. 
Event time: 8/8/2011 10:26:04 AM 
Event time (UTC): 8/8/2011 2:26:04 PM 
Event ID: 6b56761296d24e1aa01038ce125be044 
Event sequence: 97 
Event occurrence: 1 
Event detail code: 0 

Application information: 
    Application domain: / LM / W3SVC / 1 / ROOT / -2-129599642336131368 
    Trust level: Full 
    Application Virtual Path: /
    Application Path: 
    Machine name: 

Process information: 
    Process ID: 6396 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL \ MyAppPool

Exception information: 
    Exception type: System.Exception
    Exception message: STACKTRACE


+4
source share
3 answers

The default behavior of ASP.NET is to write unhandled exceptions to the event log. A way to prevent it from being written to the event log is to process them yourself. You can do this through the Global.asax file in the Application_OnError handler.

Server.ClearError(), .

+4

, , . <system.web><healthMonitoring> web.config, . , System.Web.Management.WebBaseErrorEvent, ASP.NET .

ASP.NET. , , <system.web><healthMonitoring><rules>. , , , - , :

<healthMonitoring>
  <rules>
    <clear />
  </rules>
</healthMonitoring>

, .

+1

, , Windows , .

0

All Articles