We have a VB.Net 2.0 application which logs a great many events.
As is usual practice, to stop the application failing when HDD space runs out we have the "Overwrite events as needed" option set.
This means that we only ever have around 6 hours of logs available to us at any one time.
Most of the logs are information only and can be discarded however there are some which we want to keep for troubleshooting purposes.
Due to business policies we are unable to turn down the logging level.
Sample code:
Private Shared Sub WriteToEventLog(ByVal message As String,
ByVal type As EventLogEntryType,
ByVal componentName As String)
Dim eventLog As New EventLog("OurAppEvents")
eventLog.Source = componentName
eventLog.WriteEntry(message, type)
End Sub
Is there any way of "reserving" a log entry so that it does not get deleted when the overwrite happens?