开发者

Creating an application and event logs in the "applications and services logs" section of the event viewer

开发者 https://www.devze.com 2023-02-14 05:00 出处:网络
I have a .NET application in which I want to write unhandled events to the event viewer. I noticed that there is a directory called \"Applications and Services Logs\". I would like to create an entry

I have a .NET application in which I want to write unhandled events to the event viewer. I noticed that there is a directory called "Applications and Services Logs". I would like to create an entry for my application in this directory and write any unhandled events to it. 开发者_运维知识库Unfortunately, I can't find any documentation.

Is this even possible? If so, how?

Thanks!


You can create a log entry with this method :

public static void CreateEventSource(
    string YourApplication,
    string YourLogName    )

CreateEventSource

Doc: 1: http://msdn.microsoft.com/en-us/library/2awhba7a.aspx

Example :Eventlog

0

精彩评论

暂无评论...
验证码 换一张
取 消