title: Azure : I don't see all my Trace log
body: <p>I work with VisualStudio2010 and emulators tools (June 2012).<br>
  I create a new Work Role Project.</p>
  
  <p>In the <em>WorkerRole.cs</em> file :  </p>
  
  <pre class="lang-cs prettyprint-override"><code>public class WorkerRole : RoleEntryPoint
  {
      public override void Run()
      {
          Trace.TraceInformation("Begin loop at " + DateTime.Now);
          int i = 0;
          while (true)
          {
              Trace.TraceInformation("I'm in a loop (" + i++ + ") at " + DateTime.Now + ".");
              Thread.Sleep(15000);
          }
      }
  
      private void InitLogs()
      {
          DiagnosticMonitorConfiguration config = DiagnosticMonitor.GetDefaultInitialConfiguration();
          config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
          config.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
  
          DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);
          Trace.TraceInformation("Start at " + DateTime.Now);
      }
  
      public override bool OnStart()
      {
          ServicePointManager.DefaultConnectionLimit = 12;
          InitLogs();
          return base.OnStart();
      }
  }
  </code></pre>
  
  <p>In my <em>settings</em> :  </p>
  
  <pre class="lang-cs prettyprint-override"><code>Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString = UseDevelopmentStorage=true
  </code></pre>
  
  <p>In <em>app.config</em> :</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;system.diagnostics&gt;
      &lt;trace&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;/trace&gt;
  &lt;/system.diagnostics&gt;
  </code></pre>
  
  <p></p>
  
  <p>When I Start Debugging (F5) in local, I can see this in the <em>Windows Azure Compute Emulator</em> :</p>
  
  <pre><code>[fabric] Role Instance: deployment16(275).WindowsAzureProject2.WorkerRole1.0
  [fabric] Role state Started
  [Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
  [runtime] Role entrypoint . CALLING   OnStart()
  [Diagnostics]: Acquired mutex
  [Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
  [Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5 -InitializedEvent WADM-StartUp-54bc885b045e40ecaf8474c810199ab5 -parent 7656 -events
  [Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
  [Diagnostics]: Mutex already taken
  [Diagnostics]: Creating config channel client
  [Diagnostics]: Attempting to connect to server...
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:40.111Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6920
  [MonAgentHost] Error:     4636
  [MonAgentHost] Error:     SelfMonitoring
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
  [MonAgentHost] Error:     MASelfMon::GetProcCntrs
  [MonAgentHost] Error:     1421
  [MonAgentHost] Error:     ffffffffc0000bb8
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
  [Diagnostics]: Creating config channel server
  [MonAgentHost] Output: Agent will exit when WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5 is signaled.
  [MonAgentHost] Output: Will signal WADM-StartUp-54bc885b045e40ecaf8474c810199ab5 after the agent is initialized.
  [MonAgentHost] Output: Registered as an event consumer.
  [MonAgentHost] Output: Agent will exit when parent process 7656 exits.
  [MonAgentHost] Output: Monitoring Agent Started
  [Diagnostics]: Starting configuration channel polling
  [Diagnostics]: Connection sucessful, sending config
  [WaWorkerHost.exe] Start at 09/07/2012 10:17:40
  [runtime] Role entrypoint . COMPLETED OnStart()
  [Diagnostics]: Config request received
  [Diagnostics]: Signalling process restart on event = WADDM-ShutDown-54bc885b045e40ecaf8474c810199ab5
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:40.662Z
  [MonAgentHost] Error:     3
  [MonAgentHost] Error:     6920
  [MonAgentHost] Error:     4636
  [MonAgentHost] Error:     SelfMonitoring
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
  [MonAgentHost] Error:     MASelfMon::StartTerminationCountdown
  [MonAgentHost] Error:     1088
  [MonAgentHost] Error:     10011
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     Not starting termination thread inside a client hosted monitoring agent
  [MonAgentHost] Output: Exiting the monitoring agent 6920 after the shutdown event was signaled.
  [MonAgentHost] Output: Monitoring Agent Stopped
  [Diagnostics] Information: Diagnostic process exited with code: 0
  [runtime] Role entrypoint . CALLING   Run()
  [WaWorkerHost.exe] Begin loop at 09/07/2012 10:17:40
  [WaWorkerHost.exe] I'm in a loop (0) at 09/07/2012 10:17:40.
  [Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
  [Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf -InitializedEvent WADM-StartUp-5548c4bc522e4f858d6ab6df287747cf -parent 7656 -events
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:17:42.930Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6260
  [MonAgentHost] Error:     5472
  [MonAgentHost] Error:     SelfMonitoring
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
  [MonAgentHost] Error:     MASelfMon::GetProcCntrs
  [MonAgentHost] Error:     1421
  [MonAgentHost] Error:     ffffffffc0000bb8
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
  [MonAgentHost] Output: Agent will exit when WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf is signaled.
  [MonAgentHost] Output: Will signal WADM-StartUp-5548c4bc522e4f858d6ab6df287747cf after the agent is initialized.
  [MonAgentHost] Output: Registered as an event consumer.
  [MonAgentHost] Output: Agent will exit when parent process 7656 exits.
  [MonAgentHost] Output: Monitoring Agent Started
  [Diagnostics]: Starting configuration channel polling
  [WaWorkerHost.exe] I'm in a loop (1) at 09/07/2012 10:17:55.
  [WaWorkerHost.exe] I'm in a loop (2) at 09/07/2012 10:18:10.
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:15.202Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6260
  [MonAgentHost] Error:     5412
  [MonAgentHost] Error:     NetTransport
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
  [MonAgentHost] Error:     OpenHttpSession
  [MonAgentHost] Error:     749
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     2f94
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:22.313Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6260
  [MonAgentHost] Error:     7912
  [MonAgentHost] Error:     NetTransport
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
  [MonAgentHost] Error:     OpenHttpSession
  [MonAgentHost] Error:     749
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     2f94
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:24.578Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6260
  [MonAgentHost] Error:     7912
  [MonAgentHost] Error:     NetTransport
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
  [MonAgentHost] Error:     OpenHttpSession
  [MonAgentHost] Error:     749
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     2f94
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
  [WaWorkerHost.exe] I'm in a loop (3) at 09/07/2012 10:18:25.
  [Diagnostics]: Checking for configuration updates 09/07/2012 10:18:40.
  [WaWorkerHost.exe] I'm in a loop (4) at 09/07/2012 10:18:40.
  [Diagnostics]: Signalling process restart on event = WADDM-ShutDown-5548c4bc522e4f858d6ab6df287747cf
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:40.731Z
  [MonAgentHost] Error:     3
  [MonAgentHost] Error:     6260
  [MonAgentHost] Error:     5472
  [MonAgentHost] Error:     SelfMonitoring
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
  [MonAgentHost] Error:     MASelfMon::StartTerminationCountdown
  [MonAgentHost] Error:     1088
  [MonAgentHost] Error:     10011
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     Not starting termination thread inside a client hosted monitoring agent
  [MonAgentHost] Output: Exiting the monitoring agent 6260 after the shutdown event was signaled.
  [MonAgentHost] Output: Monitoring Agent Stopped
  [Diagnostics] Information: Diagnostic process exited with code: 0
  [Diagnostics] Information: C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor
  [Diagnostics] Information: c:\users\benjamin.lux\documents\visual studio 2010\Projects\WindowsAzureProject2\WindowsAzureProject2\csx\Debug\roles\WorkerRole1\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\benjamin.lux\AppData\Local\dftmp\Resources\0f8904a1-352a-4726-a1fc-17fb8d128797\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-88b62f24f2154dbabb56a138a624ff8a -InitializedEvent WADM-StartUp-88b62f24f2154dbabb56a138a624ff8a -parent 7656 -events
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:18:42.920Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6068
  [MonAgentHost] Error:     7820
  [MonAgentHost] Error:     SelfMonitoring
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\selfmon.cpp
  [MonAgentHost] Error:     MASelfMon::GetProcCntrs
  [MonAgentHost] Error:     1421
  [MonAgentHost] Error:     ffffffffc0000bb8
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     PdhAddCounter(\Process(MonAgentHost#0)\ID Process) failed
  [MonAgentHost] Output: Agent will exit when WADDM-ShutDown-88b62f24f2154dbabb56a138a624ff8a is signaled.
  [MonAgentHost] Output: Will signal WADM-StartUp-88b62f24f2154dbabb56a138a624ff8a after the agent is initialized.
  [MonAgentHost] Output: Registered as an event consumer.
  [MonAgentHost] Output: Agent will exit when parent process 7656 exits.
  [MonAgentHost] Output: Monitoring Agent Started
  [Diagnostics]: Starting configuration channel polling
  [WaWorkerHost.exe] I'm in a loop (5) at 09/07/2012 10:18:55.
  [WaWorkerHost.exe] I'm in a loop (6) at 09/07/2012 10:19:10.
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:15.198Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6068
  [MonAgentHost] Error:     612
  [MonAgentHost] Error:     NetTransport
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
  [MonAgentHost] Error:     OpenHttpSession
  [MonAgentHost] Error:     749
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     2f94
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:22.313Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6068
  [MonAgentHost] Error:     7748
  [MonAgentHost] Error:     NetTransport
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
  [MonAgentHost] Error:     OpenHttpSession
  [MonAgentHost] Error:     749
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     2f94
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
  [MonAgentHost] Error: MA EVENT: 2012-07-09T08:19:24.577Z
  [MonAgentHost] Error:     2
  [MonAgentHost] Error:     6068
  [MonAgentHost] Error:     7748
  [MonAgentHost] Error:     NetTransport
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\shared\nettransport\src\netutils.cpp
  [MonAgentHost] Error:     OpenHttpSession
  [MonAgentHost] Error:     749
  [MonAgentHost] Error:     0
  [MonAgentHost] Error:     2f94
  [MonAgentHost] Error:     
  [MonAgentHost] Error:     WinHttpGetProxyForUrl(http://127.0.0.1) failed ERROR_WINHTTP_AUTODETECTION_FAILED (12180)
  [WaWorkerHost.exe] I'm in a loop (7) at 09/07/2012 10:19:25.
  [WaWorkerHost.exe] I'm in a loop (8) at 09/07/2012 10:19:40.
  </code></pre>
  
  <p>So I can see Trace message 0, 1, 2, 3, 4, 5, 6, 7 and 8.<br>
  But when I take a look to my "WADLogsTable" I have just message : Start, 1, 2, 3 and 4,  <strong>no Begin, number 0 and 5, 6, 7 and 8</strong>.</p>
  
  <p>Tow main questions : 
  Where are they ?<br>
  What it happens if I stop an instance betwen tow "transfer period" of logging ? 
  In this case my last logs are save or I have to force the upload by use the <em>DeploymentDiagnosticManager</em> Class ?  </p>
  
  <p>Second question is because maybe the 4 lasts messages aren't a problem.  </p>
  
  <p>For Information errors in the <em>Windows Azure Compute Emulator</em> aren't importants : <a href="http://blogs.msdn.com/b/avkashchauhan/archive/2011/01/20/winhttpgetproxyforurl-failed-error-winhttp-autodetection-failed-12180-error-message-in-windows-azure-infrastructure-log.aspx" rel="nofollow">blog post</a></p>
  
  <p>Edit 09/07/2012 : clarify the situation.</p>
  
  <p><strong>Edit</strong> 16/07/2012 : If someone could create a new worker role project and add the code above then press F5. I want know if it is a personal deal or a problem of emulator (or other).</p>