<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Atlantic BT &#187; .svclog</title>
	<atom:link href="http://www.atlanticbt.com/blog/tag/svclog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.atlanticbt.com/blog</link>
	<description>Our Thoughts</description>
	<lastBuildDate>Thu, 09 Sep 2010 14:14:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Listen Up to the WCF XmlWriterTraceListener!</title>
		<link>http://www.atlanticbt.com/blog/listen-up-to-the-wcf-xmlwritertracelistener/</link>
		<comments>http://www.atlanticbt.com/blog/listen-up-to-the-wcf-xmlwritertracelistener/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 13:55:06 +0000</pubDate>
		<dc:creator>Daryl Hemeon</dc:creator>
				<category><![CDATA[Web Programming]]></category>
		<category><![CDATA[.svclog]]></category>
		<category><![CDATA[IIS]]></category>
		<category><![CDATA[listeners]]></category>
		<category><![CDATA[MSDN]]></category>
		<category><![CDATA[Serialization]]></category>
		<category><![CDATA[SvcTraceViewer.exe]]></category>
		<category><![CDATA[System.Diagnostics]]></category>
		<category><![CDATA[System.ServiceModel]]></category>
		<category><![CDATA[tracing]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Windows Communication Foundation]]></category>
		<category><![CDATA[XmlWriterTraceListener]]></category>

		<guid isPermaLink="false">http://www.atlanticbt.com/blog/?p=1542</guid>
		<description><![CDATA[&#8220;Welcome to WCF, don&#8217;t let the config files hit you in the a$$ on the way in or the way out.&#8221; I have just started really digging into building some services hosted in IIS using WCF and the above quote is what the sign says on most articles and books about Microsoft&#8217;s Windows Communication Foundation [...]]]></description>
			<content:encoded><![CDATA[<p>&#8220;Welcome to WCF, don&#8217;t let the config files hit you in the a$$ on the way in or the way out.&#8221;</p>
<p>I have just started really digging into building some services hosted in <acronym title="Internet Information Services">IIS</acronym> using <dfn title="Windows Communication Foundation is an application programming interface in the .NET Framework for building connected, service-oriented applications.">WCF</dfn> and the above quote is what the sign says on most articles and books about Microsoft&#8217;s Windows Communication Foundation (or maybe just this one). I am in the process of creating several services for our company and for the most part I have been achieving success…except for a nasty serialization issue I encountered yesterday.</p>
<p>I have been adding lots of trace statements to my code to make sure I have the appropriate amount of diagnostic capabilities in my suite of services to figure out just such a problem.</p>
<p>I execute my unit test…and of course it dies…but where?  In the client?  In the service?  Did my call even make it to my service?</p>
<p>I found this <a href="http://msdn.microsoft.com/en-us/library/aa702726.aspx">article</a> on <abbr title="Microsoft Developer Network">MSDN</abbr> that helped me immediately solve my problem.  Enter your old friend logging and tracing…here are the settings:</p>
<pre>&lt;configuration&gt;
 &lt;system.diagnostics&gt;
  &lt;sources&gt;
    &lt;source name="System.ServiceModel"
            switchValue="Warning"
            propagateActivity="true" &gt;
      &lt;listeners&gt;
        &lt;add name="xml"/&gt;
      &lt;/listeners&gt;
    &lt;/source&gt;
    &lt;source name="myUserTraceSource"
            switchValue="Warning, ActivityTracing"&gt;
      &lt;listeners&gt;
        &lt;add name="xml"/&gt;
      &lt;/listeners&gt;
    &lt;/source&gt;
  &lt;/sources&gt;
  &lt;shareListeners&gt;
    &lt;add name="xml"
         type="System.Diagnostics.XmlWriterTraceListener"
               initializeData="C:\logs\Traces.svclog" /&gt;
  &lt;/sharedListeners&gt;
 &lt;/system.diagnostics&gt;

&lt;system.serviceModel&gt;
  &lt;diagnostics wmiProviderEnabled="true"&gt;
  &lt;/diagnostics&gt;
 &lt;/system.serviceModel&gt;
&lt;/configuration&gt;</pre>
<p>With a couple quick config settings a complete trace in XML of my problem was revealed to me — serializing an enumeration.  Now with most tracing capabilities you have to be careful about how verbose you want it to be and you don&#8217;t always want the hose running all the time, only when you have to wash the car&#8230;you dig?</p>
<p>The other cool item of note is that the <strong>.svclog</strong> file that gets generated comes with it&#8217;s very own reader that allows you to parse the service log.  It is called the Service Trace Viewer Tool or SvcTraceViewer.exe. <a href="http://msdn.microsoft.com/en-us/library/ms732023.aspx">Check it out!</a></p>
<p>Have fun with WCF…it is where the all the contracts are strong, all the services are good looking, and all the developers are above average.  Cheers!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.atlanticbt.com/blog/listen-up-to-the-wcf-xmlwritertracelistener/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
