title: Azure Trace Logs working on Emulator but not working on the cloud
body: <p>I have a TraceManager class that basically calls the TraceEvent method from the System.Diagnostics.TraceSource class.</p>
  
  <pre><code>TraceSource source = new TraceSource("MyTraceSource");
  void TraceInternal(TraceEventType eventType, string message)
  {
      if (source != null)
      {
          try
          {
              source.TraceEvent(eventType, (int)eventType, message);
          }
          catch (SecurityException)
          {
              //Cannot access to file listener or cannot have
              //privileges to write in event log
              //do not propagete this :-(
          }
      }
  }
  
  public void TraceError(string message)
  {
      if (String.IsNullOrEmpty(message))
          throw new ArgumentNullException("message", Messages.exception_InvalidTraceMessage);
  
      TraceInternal(TraceEventType.Error, message);
  }
  </code></pre>
  
  <p>So, for tracing an error I call the TraceError method.</p>
  
  <p>Well, this is the code I use in my WebRole OnStart method:</p>
  
  <pre><code>DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialConfiguration();
  TimeSpan transferPeriod = TimeSpan.FromMinutes(1.0);
  
  dmc.Logs.ScheduledTransferPeriod = transferPeriod;
  dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
  
  DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", dmc);
  </code></pre>
  
  <p>This is my configuration in my web.config:</p>
  
  <pre><code>&lt;system.diagnostics&gt;
    &lt;sources&gt;
      &lt;source name="MyTraceSource" switchName="sourceSwitch" switchType="System.Diagnostics.SourceSwitch"&gt;
        &lt;listeners&gt;
          &lt;add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics"&gt;
            &lt;filter type="" /&gt;
          &lt;/add&gt;
        &lt;/listeners&gt;
      &lt;/source&gt;
    &lt;/sources&gt;
    &lt;switches&gt;
      &lt;add name="sourceSwitch" value="Verbose"/&gt;
    &lt;/switches&gt;
  &lt;/system.diagnostics&gt;
  </code></pre>
  
  <p>And these are my configuration settings for my WebRole:</p>
  
  <pre><code>&lt;ConfigurationSettings&gt;
    &lt;Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=ValidAcountName;AccountKey=ValidAcountKey" /&gt;
  &lt;/ConfigurationSettings&gt;
  </code></pre>
  
  <p>And finaly I have the Diagnostics Import in my ServiceDefinition:</p>
  
  <pre><code>&lt;Imports&gt;
    &lt;Import moduleName="Diagnostics" /&gt;
  &lt;/Imports&gt;
  </code></pre>
  
  <p>When I run my application from Visual Studio under the Azure Emulators it works fine. Even I can change my ConfigurationSettings for saving my logs in the storage emulator or in my cloud storage. But when I deploy it to azure I can't see any Log.</p>
  
  <p>Any ideas?</p>