How to create Event Log in Service

1. In a property of Class view select tool EventLog from Component Tab and drop in a class view.
2. Write the code  in a Constructor
For example.

public Class1()


// This call is required by the Windows.Forms Component Designer.






eventLog1.Source = “FileMoveSourse”;

// the event log source by which

//the application is registered on the computer

eventLog1.Log = “FileMove”;


// TODO: Add any initialization after the InitComponent call


3. Write code in onStart() method

eventLog1.WriteEntry(“my service started”);

4. Write code in onStop() method

eventLog1.WriteEntry(“my service stoped”);

Now after installation of service,You can check in eventLogger


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s