title: Logging best practices
body: <p>I'd like to get stories on how people are handling tracing and logging in real applications. Here are some questions that might help to explain your answer. </p>
  
  <p><strong>Frameworks</strong></p>
  
  <p>What frameworks do you use?</p>
  
  <ul>
  <li>log4net</li>
  <li>System.Diagnostics.Trace</li>
  <li>System.Diagnostics.TraceSource</li>
  <li>Logging application block</li>
  <li>Other?</li>
  </ul>
  
  <p>If you use tracing, do you make use of Trace.Correlation.StartLogicalOperation? </p>
  
  <p>Do you write this code manually, or do you use some form of aspect oriented programming to do it? Care to share a code snippet? </p>
  
  <p>Do you provide any form of granularity over trace sources? E.g., WPF TraceSources allow you to configure them at various levels:</p>
  
  <ul>
  <li>System.Windows - <em>settings for all of WPF</em></li>
  <li>System.Windows.Animation - <em>override specifically for Animation.</em></li>
  </ul>
  
  <p><strong>Listeners</strong></p>
  
  <p>What log outputs do you use?</p>
  
  <ul>
  <li>Text files</li>
  <li>XML files</li>
  <li>Event log</li>
  <li>Other?</li>
  </ul>
  
  <p>If using files, do you use rolling logs or just a single file? How do you make the logs available for people to consume? </p>
  
  <p><strong>Viewing</strong></p>
  
  <p>What tools to you use for viewing the logs?</p>
  
  <ul>
  <li>Notepad</li>
  <li>Tail</li>
  <li>Event viewer</li>
  <li>Systems Center Operations Manager/Microsoft Operations Manger</li>
  <li>WCF Service Trace Viewer</li>
  <li>Other?</li>
  </ul>
  
  <p>If you are building an ASP.NET solution, do you also use ASP.NET Health Monitoring? Do you include trace output in the health monitor events? What about Trace.axd? </p>
  
  <p>What about custom performance counters? </p>