简体   繁体   中英

Windows Event Log Concerns?

I am currently on a team that is upgrading an older application to C# 4.0. One of the items being upgraded is the error logging aspect of the app. Upon suggesting that we use the Windows Event Log for this purpose, a few on the team stated that Microsoft "changes the interface to the event log with each release."

I have not been able to confirm this. Does anyone know of problems creating .Net applications that require writing to the Event Log? It doesn't make sense to me that this functionality would be offered only to be rendered inoperable on the next release of Windows.

That's utter nonsense. The System.Diagnostics.EventLog component has been stable since .NET 1.0.

I've written applications that log to the Windows event log. I would say that Microsoft bends over backwards to ensure application compatibility as they move from one version of the OS to the next. It's highly unlikely that you would encounter many compatibility issues. However there was a change between XP and Vista that required special permissions to be able to write to the event log. Once that obstacle has been cleared, it's not that hard.

Also, you're better off using something like Log4Net to give yourself some flexibility as to where your log messages end up. I believe that library supports the Event Log as a possible logging target.

I don't think that is the case, that would break a lot of applications and it would not be used in that case.

If you are that concerned, you could use a library like log4net Correct way of using log4net (logger naming) ?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM