In C#, When we create the custom event log through windows service, Where does the eventlog gets stored?

I created a windows service. Through windows service, I created a custom event log and i'm writing the exceptions into the log.
But i'm wondering, Where does the event log gets stored?

If you look  at the application, security event log files, each is associated with a physical location llike (C:\WINDOWS\system32\config\AppEvent.Evt ),
So the question is, How do I associate a custom event log to a physical file OR Where does the custom event log gets stored?

Thanks.
GLGroupAsked:
Who is Participating?
 
rameedevCommented:
If u want your Servie Info to be stored in a Custom Event Log then u need to do this in your Windows Service Code

private EventLog evntLog;

public Service1()
{
InitializeComponent();
                  
if(!EventLog.SourceExists("Custom"))
{
      EventLog.CreateEventSource("Custom", "CustomLog");
}
evntLog = new EventLog(" ");
evntLog.Source = "Custom";
}

so when u run your service and want to check your custom Log..Navigate to ControlPanel >> Administrative Tools >> Event Viewer There u can find CustomLog and on clciking inisde u will find your Cutome Log

Regards
RameeDev
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.