How to store event log in Folder

Total Post:101

Points:709
 1198  View(s)
Ratings:
Rate this:

I'm using the System.Diagnostics namespace to log errors, warning and information. 

Using Windows 7 I see that the log I've set for the project is under "Applications and Services Logs". 

How can I set in code to create a folder and put it under "Applications and Services Logs[SOME FOLDER]\Applications and Services Logs"?

  1. Post:378

    Points:2694
    Re: How to store event log in Folder

    Hi Pravesh, 

    try this:

    EventLog.CreateEventSource("Source", "Log name");

    EventLog.WriteMessage("Source", "Your message");

Answer