Create LogFile for .net webservice

Hello Expert,

I want to create log file for the webservice. I want to record time and exception occur during operation.
Can I have step by step details or code.

Who is Participating?
binaryevoConnect With a Mentor Commented:
I would use NLog, its easy and quick and can be found below along with some tutorials:

Hope this helps
I to would recommend using NLog. If your using WCF then you can create a behavior and implement IErrorHandler which will allow you to catch and log any error that escapes your service and provide a meaningful message back to the client without exposing the exception details.
Kiran SonawaneProject LeadCommented:
also take a look at lof4net (awesome) to catch all kind of exception

All Courses

From novice to tech pro — start learning today.