Click here to Skip to main content
15,879,326 members
Articles / Programming Languages / C#

LoggingBehavior - How to Connect Log-prints with the WCF Operation's Details, using a Simple Behavior

Rate me:
Please Sign up or sign in to vote.
5.00/5 (15 votes)
27 Sep 2011CPOL6 min read 50.5K   1.5K   29  
In this article, I explain, step by step, how we can use a WCF behavior for logging operation's invoke and result, errors, warnings and information logs that include the operation's details.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace Example.Contracts
{
    [ServiceContract]
    public interface IMySecondService
    {
        [OperationContract]
        int MyOperation(int myArg);
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Israel Israel
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions