title: How to use TraceSource across classes
body: <p>I was recently studying documentation on <a href="http://msdn.microsoft.com/en-us/library/system.diagnostics.tracesource.aspx" rel="noreferrer">TraceSource</a>. Microsift says that TraceSource is a new way and should be used instead of old Trace class. </p>
  
  <pre><code>// create single TraceSource instance to be used for logging
  static TraceSource ts = new TraceSource("TraceTest");
  
  // somewhere in the code
  ts.TraceEvent(TraceEventType.Warning, 2, "File Test not found");
  </code></pre>
  
  <p>Now my question. You have large project with several assemblies where you have lots of classes. Say you wanna trace specific bit of functionality that is spread across classes. Obvious idea is that you need to create one specific TraceSource . </p>
  
  <p>1) To work with Tracesource I need to create instance first. What is MS thinking about sharing this instance across various classes or assemblies? Should I create one dummy class with static singleton property? What are you doing in that case. </p>
  
  <p>2) Why do I need TraceSource instance? Every propery is described in the configuration file. The old logic based on Trace class did not require some instance and provided the way to work with static methods only.</p>