Event log full check

  • Thread starter Thread starter kilik3000
  • Start date Start date
K

kilik3000

Is there a way to determine if the event log is full without writing
to it and then catching the exception?

Like a "TryWrite" or something.

-Thx
 
Is there a way to determine if the event log is full without writing
to it and then catching the exception?

That's about the only thing you can do is have a routine to do it. Most
people would clear the log every time the program is started to avoid the
situation or use a Timer control to clear the log, periodically to avoid the
situation.

You can also right-click and Event log and go to Properties to make
adjustments there as well.
 
That's about the only thing you can do is have a routine to do it. Most
people would clear the log every time the program is started to avoid the
situation or use a Timer control to clear the log, periodically to avoid the
situation.

You can also right-click and Event log and go to Properties to make
adjustments there as well.

We have maximam log size and overwrite options for each log types - in
our case Applciaiton Log.

Or you can configure in code - EventLog.OverflowAction =
OverflowAction.OverwriteOlder| OverflowAction.DoNotOverwrite |
OverflowAction.OverwriteAsNeeded; //any of these vaues.

If this could help...I don't see any way to apply a TryWrite method.I
guess Arnold has given the strategy to clear the log upon log entries
reaching a particular count.
 
Back
Top