From: John on
Hi

My app writes events to event log from time to time using below code;

Dim elog As New System.Diagnostics.EventLog("My Event Log")
Dim EventType As System.Diagnostics.EventLogEntryType
EventType = System.Diagnostics.EventLogEntryType.Error
elog.WriteEntry("Some text", EventType, "1001")

Problem is this app is installed on multiple remote sites and form time to
time the event log becomes full one or the other pc and app start to give
error. Is there a way to set the Event Log, Log Size setting to 'Overwrite
events as needed' via code so the event log never fills up?

Many Thanks

Regards


From: dotNetDave on
You need to go to the event log on the machine. There is a setting to have it
overwrite old entries. I thought this was the default on newer server OS's.

David

======================================
David McCarter [Microsoft MVP]
www.dotNetTips.com
David McCarter''''s .NET Coding Standards available at:
http://codingstandards.notlong.com


"John" wrote:

> Hi
>
> My app writes events to event log from time to time using below code;
>
> Dim elog As New System.Diagnostics.EventLog("My Event Log")
> Dim EventType As System.Diagnostics.EventLogEntryType
> EventType = System.Diagnostics.EventLogEntryType.Error
> elog.WriteEntry("Some text", EventType, "1001")
>
> Problem is this app is installed on multiple remote sites and form time to
> time the event log becomes full one or the other pc and app start to give
> error. Is there a way to set the Event Log, Log Size setting to 'Overwrite
> events as needed' via code so the event log never fills up?
>
> Many Thanks
>
> Regards
>
>
> .
>