System EVENLOG for logging

if you are planning to use system even viewer for loging purpose. then,below piece of code will work for you!!

     this.eventLog.Source = “Application“;
     this.eventLog.Log = “Application“;
     this.eventLog.WriteEntry(“This is Warning for evenlog!!”, EventLogEntryType.Warning);
     this.eventLog.WriteEntry(“This is Information for evenlog!!”, EventLogEntryType.Information);
     this.eventLog.WriteEntry(“This is Error for evenlog!!”, EventLogEntryType.Error);

below is the screen shot from event viewer with logging details.

Md. jawed


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