I have a Windows Service which has been running happily for months, writing the occasional message to a private Windows event log using System.Diagnostics.EventLog.WriteEntry.
Just today, however, my service has stopped running, and the Application event log contains the error:
Service cannot be started. System.ComponentModel.Win32Exception: The event log file is full.
It didn't look that full to me; a few hundred events, certainly fewer than the Security log.
Even supposing I can't log that many events, how am I supposed to stop the OS from stopping my service when it thinks it has enough events Can I tell it to overwrite old events Should I delete old events How How do I know when the event log file "is full"

Windows Service event log full?
arongpan
The framework does not seem to have an abstraction for it but some quick research brought up the following ... it appears to be controlled by a registry key (note the retention key). I would imagine there might also be a WMI interface to this but could not locate one.
here is a c/p of the info.
HKEY_LOCAL_MACHINESystemCurrentControlSetServicesEventLog
ozhonetech
its a property on the event log ... do you need to know how to do it in general or how to do it via code during creation of the log If just in general you can do it through event viewer (http://www.rsinc.com/services/techtip.asp ttid=3469)
Cheers,
Greg
spelger