save event log file in c#

  • Thread starter Thread starter Lucy
  • Start date Start date
L

Lucy

I'd like to save off the Application event log on my servers whenever
it reaches 80% capacity and then clear the log (so that I can wait
until the next time I reach 80% capacity to save it off to a file
again). Does anyone know of any methods I can use to do this?
Thanks in advance.
 
Off the top of my head, no.  But it's the kind of thing that would
typically be supported via WMI, which .NET provides APIs for.

So, if you can figure out the unmanaged WMI way to do it, you can then
translate that into the managed WMI API to do the same thing from
managed code.

Pete

how do i use wmi to save off the event log? if i save this off and
then clear out the event log regularly, does this ensure that i save
off all events or is there a chance that i could miss one in between
the time that i save it and then clear it?
 
Back
Top