<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx</link><description>The April issue of the MSDN Magazine just went on line. It contains an article I wrote that describes some advanced extensibility supported by System.Diagnostic tracing APIs. It talks about creating custom TraceListeners, Switches, and TraceSources.</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#597125</link><pubDate>Sun, 14 May 2006 02:42:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:597125</guid><dc:creator>checlark</dc:creator><description>Sorry if this message is up here twice.&lt;br&gt;&lt;br&gt;I am trying to run the code but I keep getting the cannot find type error for the EmailListener. I have checked the namespace and they are identical.&lt;br&gt;&lt;br&gt;Any ideas or direction?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Che'&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=597125" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#597112</link><pubDate>Sun, 14 May 2006 01:54:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:597112</guid><dc:creator>Che Clark</dc:creator><description>I am trying to run this code but keep getting the following error:&lt;br&gt;&lt;br&gt;System.Configuration.ConfigurationErrorsException was unhandled&lt;br&gt; &amp;nbsp;Message=&amp;quot;Couldn't find type for class MsdnMagazine.Samples.Tracing.EMailListener ,Extensions.&amp;quot;&lt;br&gt; &amp;nbsp;Source=&amp;quot;System&amp;quot;&lt;br&gt; &amp;nbsp;BareMessage=&amp;quot;Couldn't find type for class MsdnMagazine.Samples.Tracing.EMailListener ,Extensions.&amp;quot;&lt;br&gt; &amp;nbsp;Line=0&lt;br&gt; &amp;nbsp;StackTrace:&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Diagnostics.TraceUtils.GetRuntimeObject(String className, Type baseType, String initializeData)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Diagnostics.TypedElement.BaseGetRuntimeObject()&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Diagnostics.ListenerElement.GetRuntimeObject()&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Diagnostics.ListenerElementsCollection.GetRuntimeObject()&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Diagnostics.TraceSource.Initialize()&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String format, Object[] args)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Diagnostics.TraceSource.TraceInformation(String message)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at MsdnMagazine.Samples.Tracing.test.Main() in F:\CLRInsideOut0604\CLRIO\CLRInsideOut0604\Tests\test.cs:line 27&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.AppDomain.nExecuteAssembly(Assembly assembly, String[] args)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Threading.ThreadHelper.ThreadStart_Context(Object state)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; at System.Threading.ThreadHelper.ThreadStart()&lt;br&gt;&lt;br&gt;&lt;br&gt;The namespace defined in the config matches exactly the namespace for the EmailListener class.&lt;br&gt;&lt;br&gt;Any ideas or direction?&lt;br&gt;&lt;br&gt;Thanks,&lt;br&gt;Che'&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=597112" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#581068</link><pubDate>Sat, 22 Apr 2006 02:44:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:581068</guid><dc:creator>Krzysztof Cwalina</dc:creator><description>Max, you are right. It should be strData.Append(data[i].ToString()); &lt;br&gt;Sorry for that and thanks for catching it.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=581068" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#580930</link><pubDate>Fri, 21 Apr 2006 22:53:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:580930</guid><dc:creator>Max Mulawa</dc:creator><description>Hi Krzysztof,&lt;br&gt;&lt;br&gt;Really good article, will use EmailListener in my current development work. I'm not sure if in class TraceListener2 (Figure 2) in method &lt;br&gt;&lt;br&gt;protected virtual string FormatData(object[] data) &lt;br&gt;&lt;br&gt;you should change the If condition to&lt;br&gt;&lt;br&gt; if (i != 0) strData.Append(&amp;quot;|&amp;quot;);&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;strData.Append(data[i].ToString());&lt;br&gt;&lt;br&gt;to append pipe to the &amp;nbsp;end of each string representation of the data[i] object.&lt;br&gt;&lt;br&gt;I don't know if this is a mistake, but I thought it would be useful if I'm right.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=580930" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#557276</link><pubDate>Wed, 22 Mar 2006 01:46:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:557276</guid><dc:creator>Krzysztof Cwalina</dc:creator><description>Josh, this is a very cool idea. A twist on it would be to provide a listener that tracers to an RSS feed. You could subscribe to the feed and see, let's say, critical events in your blog reader.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=557276" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#557257</link><pubDate>Wed, 22 Mar 2006 01:33:24 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:557257</guid><dc:creator>Josh Einstein</dc:creator><description>Check out the custom trace listener I developed. It was mentioned in MSDN magazine before by someone from Wintellect but I thought you might want to give it a look cause it's very useful.&lt;br&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://josheinstein.com/journal/archive/2005/06/08/520.aspx"&gt;http://josheinstein.com/journal/archive/2005/06/08/520.aspx&lt;/a&gt;&lt;br&gt;&lt;a rel="nofollow" target="_new" href="http://josheinstein.com/journal/archive/2005/06/09/539.aspx"&gt;http://josheinstein.com/journal/archive/2005/06/09/539.aspx&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=557257" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#555660</link><pubDate>Mon, 20 Mar 2006 19:50:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:555660</guid><dc:creator>Krzysztof Cwalina</dc:creator><description>We don't currently support extending the TraceEventCache. But I think it's a good idea. I would appreciate if you could file it formally at &lt;a rel="nofollow" target="_new" href="http://lab.msdn.microsoft.com/ProductFeedback/"&gt;http://lab.msdn.microsoft.com/ProductFeedback/&lt;/a&gt;. This way you could track the status of the request. &lt;br&gt;&lt;br&gt;Thanks.&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=555660" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#555642</link><pubDate>Mon, 20 Mar 2006 19:33:06 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:555642</guid><dc:creator>Alex</dc:creator><description>I would like to extend tracing, specifically TraceEventCache to have more data (for instance, windows identity, host, etc.). How do I do this?&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=555642" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#549347</link><pubDate>Sat, 11 Mar 2006 11:36:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:549347</guid><dc:creator>Krzysztof Cwalina</dc:creator><description>If you want to ensure trace, try-finally seems to be the right choice. Why not?&lt;br&gt;&lt;br&gt;But I would say that if an exception is thrown, you actually don't want the Exit event. An Enter event, optionally followed by a trace with the excetion, and the absence of the Exit event describe pretty well what actually happened.&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=549347" width="1" height="1"&gt;</description></item><item><title>re: Extending System.Diagnostics tracing APIs</title><link>http://blogs.msdn.com/b/kcwalina/archive/2006/03/08/546703.aspx#548509</link><pubDate>Fri, 10 Mar 2006 17:23:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:548509</guid><dc:creator>Martin Aupperle</dc:creator><description>What happens when an exception is thrown? The trace code for leaving the function is not executed. In C++, where we have RAII, this is easily solved: put the trace call for leaving a function in the destructor of a class and have a local object of that class in every function. &lt;br&gt;&lt;br&gt;What can be done in .NET? Introduce a try...finally block? Hope not. &lt;br&gt;&lt;br&gt;Martin&lt;br&gt;&lt;br&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=548509" width="1" height="1"&gt;</description></item></channel></rss>