title: Windows Azure Trace Log not working
body: <p>I'm sure I have missed something simple but I can't get simple Trace.WriteLine to work on Azure.</p>
  
  <p>Steps I have taken:</p>
  
  <p>Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString has been set up to our Azure storage account</p>
  
  <p>Import Module Diagnostics to service definition file.</p>
  
  <p><code>Web config</code>:</p>
  
  <pre><code>  &lt;system.diagnostics&gt;
      &lt;switches&gt;
        &lt;add name="logLevel" value="4" /&gt;
      &lt;/switches&gt;
      &lt;trace autoflush="false" indentsize="4"&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;/add&gt;
        &lt;/listeners&gt;
      &lt;/trace&gt;
  
    &lt;/system.diagnostics&gt;
  </code></pre>
  
  <p><code>WebRole.cs</code></p>
  
  <pre><code>public class WebRole : RoleEntryPoint
  {
      public override bool OnStart()
      {
  
  
          String wadConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
  
          CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue(wadConnectionString));
  
          RoleInstanceDiagnosticManager roleInstanceDiagnosticManager =
                  cloudStorageAccount.CreateRoleInstanceDiagnosticManager(
                  RoleEnvironment.DeploymentId,
                  RoleEnvironment.CurrentRoleInstance.Role.Name,
                  RoleEnvironment.CurrentRoleInstance.Id);
  
          DiagnosticMonitorConfiguration diagnosticMonitorConfiguration =
              roleInstanceDiagnosticManager.GetCurrentConfiguration();
  
          diagnosticMonitorConfiguration.Directories.ScheduledTransferPeriod =
                 TimeSpan.FromMinutes(5d);
  
          diagnosticMonitorConfiguration.Logs.ScheduledTransferPeriod =
                 TimeSpan.FromMinutes(1d);
  
          diagnosticMonitorConfiguration.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
  
          roleInstanceDiagnosticManager.SetCurrentConfiguration
                (diagnosticMonitorConfiguration);
  
          Trace.WriteLine("This is the message");
          Debug.Write("This is the debug message");
          System.Diagnostics.Trace.TraceError("message2");
          System.Diagnostics.Trace.TraceWarning("message warning");
          System.Diagnostics.Trace.TraceInformation("message warning");
          Trace.Flush();
          return base.OnStart();
  
      }
  }
  </code></pre>
  
  <p>Solution is compiled as release.</p>
  
  <p>When I view the objects in the storage account I can see a Table called WADDirectoriesTable and three blobs created called vsdeploy, wad-control-container and was-iis-logfiles.</p>
  
  <p>Nothing that looks like my Trace information.</p>
  
  <p>Many thanks</p>