title: How to Trace via category?
body: <p>.NET lets you add trace statements to code. You can use </p>
  
  <pre><code>Trace.WriteLine"(Some message"); 
  </code></pre>
  
  <p>and then define a trace listener to collect those messages to a log file. OK so far.</p>
  
  <p>But you can also do: </p>
  
  <pre><code>Trace.WriteLine"(Some message", "Category");
  </code></pre>
  
  <p>How can you set up a filter in <code>app.config</code> (ie <code>&lt;program&gt;.exe.config</code>) so that only messages with a certain value of "Category" are sent to a listener. The documentation hints that you can do this but falls short of telling you how, I think! I want to define my own categories (by subsystem) and be able to route trace to various log files when needed.</p>
  
  <p>(Yes I know all about log4net and how that can solve all my problems).</p>