Windows Event Log and Text Logs

I hope to get final answers to this great question. When writing web applications in .net, should I use the add function in the IIS access log to store what you want, or should you write to the Windows event log?

I am talking about information logging, warning logging and error logging. Would it be wise to split it and write it in the iis log and event log?

Or, if necessary for regular Windows.net applications, should they be written to their own log file or use the event log?

+6
source share
1 answer

I would advise you not to put information about your specific application in the log file II. This log file is specific to the web server, and the format of this log file is determined by the log settings in mode II. Third-party log analysis tools are available for him, and you may encounter a situation where these tools cannot analyze IIs log files, since the information you contributed there may be incorrectly formatted.

Information about a specific application is best divided into an event log or a dedicated log file. Whether it should be an event log or not is really a matter of preference. The event log information could be easier to analyze and filter using the event viewer, and therefore it would be much easier to handle. This is a well-known format that you can send to other people for further investigation, and they can easily upload them to your event viewer. Great choice for support cases. If you expect that loggin is preferable to create a specific application-specific event log so that you do not clutter the general application event log.

I would say that this is true for Windows desktop applications as well.

If you have not already done so, I also recommend that you use one of the well-known registration frameworks, such as Log4Net or Enterprise Registration Block . This will save you a lot of time and pain.

+5
source

Source: https://habr.com/ru/post/907757/


All Articles