Create LogFile for .net webservice

Posted on 2011-10-25
Last Modified: 2012-05-12
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.

Question by:parikh12
    LVL 14

    Accepted Solution

    I would use NLog, its easy and quick and can be found below along with some tutorials:

    Hope this helps
    LVL 4

    Expert Comment

    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.
    LVL 17

    Expert Comment

    also take a look at lof4net (awesome) to catch all kind of exception


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
    To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…

    733 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

    21 Experts available now in Live!

    Get 1:1 Help Now