Write to the event log in a .net project

来源:互联网 发布:甘肃网络广播电视台 编辑:程序博客网 时间:2024/05/23 00:23
 The Application Event Log that is commented out in the app.config file。

allows you to write to the event log, for debug/error info, instead of writing a text file:

http://www.samspublishing.com/articles/article.asp?p=606221&seqNum=4&rl=1

Once you uncomment all you have to do is:

Application.Log.WriteEntry("Something disasterous happened in my app :)", TraceEventType.Information);

Before you had to use a component from the toolbox, this is now available straight out of the box in the my namespace