How long does Windows store event logs from a Windows Service
Asked Answered
M

1

5

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?

Mathi answered 20/7, 2016 at 7:39 Comment(0)
I
9

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.

Impecunious answered 20/7, 2016 at 8:11 Comment(2)
What's an Mo? Is that 20 months, or meant to be 20 Megabytes (MB)?Postliminy
@Postliminy and for any future readers, yes, the max size is 20 megabytesSanjiv

© 2022 - 2024 — McMap. All rights reserved.