Event log full check

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
 
M

Mr. Arnold

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.
 
A

Aneesh P

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top