Giter Club home page Giter Club logo

wcf-extensions's Introduction

Build status

WCF-Extensions

WCF-Extensions can log the data from a request or response to anything you like. This can be helpful in a production environment where you can't sniff the trafic because of SSL certificates and breaking the production environment isn't an option either.

This projects supports writing to a TraceListener so it supports DebugView, EventLog, Files or even WebPage listeners. It is also possible to build your own and log to a database or an Azure Storage table.

How to use

Configuration

To start copy the WCFExtensions.dll to your WCF service bin folder or next to the executable of your client.

Add the below section in your app.config or web.config file in the system.serviceModel section.

<extensions>
  <behaviorExtensions>
    <add name="logBehavior" type="WCFExtensions.TraceEndpointBehaviorExtension, WCFExtensions, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  </behaviorExtensions>
</extensions>

<behaviors>
  <endpointBehaviors>
    <behavior>
      <logBehavior />
    </behavior>
  </endpointBehaviors>
</behaviors>

You can see a full sample app.config configuration here.

TODO: provide a minimal web.config sample.

With this default configuration it will log to the DefaultTraceListener. You can check the output by using DebugView. More information is available here.

For more configuration options read the TraceListeners section below.

TraceListeners

TraceListeners provide a way to log to a different output without changing the code. The default TraceListener writes to OutputDebugString which you can capture with DebugView.

The configuration below writes to a file called output.log. Notice the tracelistener parameter for the logbehavior.

<system.diagnostics>
  <trace autoflush="false">
    <listeners>
      <add name="log" type="System.Diagnostics.TextWriterTraceListener" initializeData="output.log" />
    </listeners>
  </trace>
</system.diagnostics>
 <behaviors>
  <endpointBehaviors>
    <behavior>
      <logBehavior tracelistener="log"/>
    </behavior>
  </endpointBehaviors>
</behaviors>

There are different types of TraceListener and if you want you can create your own. More documentation is available here.

Building from source

Using Visual Studio

Requirements

  • Visual Studio 2013 (or newer)

Just open the WCFExtensions.sln found in the src folder and built it like a normal project. You can also build from the commandline by calling msbuild WCFExtensions.sln.

wcf-extensions's People

Contributors

dickvdbrink avatar

Watchers

 avatar James Cloos avatar

wcf-extensions's Issues

NuGet package

  • NuSpec file
  • Automatic transformation
    • web.config
    • app.config

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.