I ran into a weird problem on a Windows XP system. My local service app logs its diagnostic messages into the Windows Event Log, so at some point those messages stopped being logged. I thought that the issue was in my code, but then I discovered that other processes can’t log messages either.
So I was wondering, is there a limit on the Windows Event Log size?
PS. I guess I need to write this specifically — I need to know/change the size from a command line or an API.
The limit and behavior depends on the log configuration. Please check in the log properties if “When maximum log size is reached” is set to “Do not overwrite events”. If so, the events will not be logged. You can set the limit there as well.
UPDATE: It turns out the question is how to check the behavior described above programmatically. Please have a look at EventLog.OverflowAction, EventLog.MaximumKilobytes, and EventLog.MinimumRetentionDays properties, that should be enough.