How often should I write to the Event Log in Windows?

285 views Asked by At

I have an automated Process that will run a certain task every hour. I am thinking of creating a logging for this that would allow the user to see, if they want, what values are being used. Should I do this in the Event Log or create a .log txt file for this?

Is there a guideline for Windows Event Logs and whether it should only be used for errors only?

Are there any issues that I should be on the lookout for if I write to the event log every hour?

1

There are 1 answers

0
Bhanu Chhabra On

First of all one line answer to question

How often should I write to the Event Log in Windows

It depends on your needs and frequency at which you want information. There is no "one size fits all" in case logging decisions.

Should I do this in the Event Log or create a .log txt file for this?

depends on your requirements and who is going to use the log. To consider the Event Log, are you sure your application will have access to write event log every time? (in simple words, Administrative privileges).

If there are no set of standards defined (assuming you are not writing it for personal use only), then you should set a convention/standard in place for organization for what to write in Event Log and what to write in Log file.

For example Event log: Unhanded exceptions and warnings Log file: Caught exception and General Information (so that if in any deployed app client can send you the log file on mail)

Is there a guideline Windows Event Logs and whether it should only be used for errors only

You can visit Enterprise logging library:

https://msdn.microsoft.com/en-us/library/dn169621.aspx

Edit:

**Why downvote without a reason !!! **