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.