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

Posted on 2005-04-13
Last Modified: 2008-01-09
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?

Question by:GLGroup
    LVL 8

    Accepted Solution

    LVL 5

    Assisted Solution

    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()
          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


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
    Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now