How to add entry/log in to Eventviewer - for begginers

 EventLog.WriteEntry("Srting source" , "String message"); 

You might be a beginner to ASP.Net and there are times you can't reproduce the error for fixing.in that case this might be the snippet come to help you.

You can place this entry in the flow of the application running where the area which can pop the error so,if your entry is not get logged to Eventviewer that will be the place of your error origin.
So make your hands dirty and try this and learn by yourself.

cheers.

11 comments: