Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How long does Windows store event logs from a Windows Service

I'm using the Windows Event Log to record logs from a custom Windows Service.

If I need to read a log of say, yesterday, I go to the EventViewer, look for my EventLog and read it. But I'm afraid of what would happen if I needed to access a log from months or even years ago. Is it possible? How long does Windows store my logs? Is it configurable from my Service?

Should I use a third-party logger like NLog, which might be better than the Windows Event Log for my service?

like image 836
MorgoZ Avatar asked Mar 12 '23 16:03

MorgoZ


1 Answers

By default, each log (eg: Application, System, etc...) is configured to reach 20 Mb max, using the FIFO principle.

You can modify this size and set up an archiving policy instead of the FIFO method, and you'll never loose your logs again.

like image 198
Leogiciel Avatar answered Mar 26 '23 19:03

Leogiciel