title: Setting the Azure Trace logging switch - why in 2 places and not 1?
body: <p>While trying to figure out how to get log information for an Azure Web/Worker role, lots of posts suggest that I need to set my configuration settings in -two- places.</p>
  
  <h3>1 Configure .config file</h3>
  
  <pre><code>&lt;system.diagnostics&gt;
      &lt;switches&gt;
        &lt;add name="logLevel" value="2" /&gt;
      &lt;/switches&gt;
      &lt;trace&gt;
        &lt;listeners&gt;
          &lt;add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"&gt;
            &lt;filter type="" /&gt;
          &lt;/add&gt;
        &lt;/listeners&gt;
      &lt;/trace&gt;
    &lt;/system.diagnostics&gt;
  </code></pre>
  
  <h3>2. Programatically (ie. OnStart method)</h3>
  
  <pre><code>DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
  config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
  config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Warning;
  DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);
  </code></pre>
  
  <p>I don't understand why everyone are suggesting that we have to define the logging filter level <strong>twice</strong>?</p>
  
  <p>Shouldn't the configuration file be sufficient?</p>