none
Diagnostics not working

    Question

  • Hi,

    I'm using log4net to do logging in my azure web role. I've followed this artice to create Azure Appender to output the logging to System.Diagnostics.Trace

    The appender also sets up  DiagnosticMonitor.Start(...); with configuration:

     var config = DiagnosticMonitor.GetDefaultInitialConfiguration();
                config.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
                config.Logs.ScheduledTransferPeriod = TimeSpan.FromSeconds(20);
                config.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromSeconds(20);
                config.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
    
                DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config); 

    to transfer the diagnostics to local storage.

    in my web.config, I have the default listener

    <system.diagnostics>
        <trace>
          <listeners>
            <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
              <filter type="" />
            </add>
          </listeners>
        </trace>
      </system.diagnostics>

    when I output some debug text into log4net, the Windows Azure Compute Emulator is not show any of the Trace outputs, however it's throwing tons of exceptions like these:

    [fabric] Role Instance: deployment16(61).LiveRacersAzure.LiveRacers.Web.0
    [fabric] Role state Started
    [Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
    [Diagnostics]: Acquired mutex
    [Diagnostics] Information: C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor
    [Diagnostics] Information: C:\Projects\Liveracers\LiveRacersMVC\LiveRacersMVC\LiveRacersAzure\csx\Debug\roles\LiveRacers.Web\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-c60feeb2196a4d2dbe774f56e077d813 -InitializedEvent WADM-StartUp-c60feeb2196a4d2dbe774f56e077d813 -parent 6204 -events
    [Diagnostics]: UpdateState(Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorStartupInfo, Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorConfiguration, )
    [Diagnostics]: Acquired mutex
    [Diagnostics] Information: C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor
    [Diagnostics] Information: C:\Projects\Liveracers\LiveRacersMVC\LiveRacersMVC\LiveRacersAzure\csx\Debug\roles\LiveRacers.Web\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-56872abc5cab4b1699b4ed21158197b7 -InitializedEvent WADM-StartUp-56872abc5cab4b1699b4ed21158197b7 -parent 7924 -events
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:50.068Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:50.068Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [Diagnostics]: Creating config channel server
    [MonAgentHost] Output: Agent will exit when WADDM-ShutDown-c60feeb2196a4d2dbe774f56e077d813 is signaled.
    [MonAgentHost] Output: Will signal WADM-StartUp-c60feeb2196a4d2dbe774f56e077d813 after the agent is initialized.
    [MonAgentHost] Output: Registered as an event consumer.
    [MonAgentHost] Output: Agent will exit when parent process 6204 exits.
    [MonAgentHost] Output: Monitoring Agent Started
    [Diagnostics]: Starting configuration channel polling
    [Diagnostics]: Creating config channel server
    [MonAgentHost] Output: Agent will exit when WADDM-ShutDown-56872abc5cab4b1699b4ed21158197b7 is signaled.
    [MonAgentHost] Output: Will signal WADM-StartUp-56872abc5cab4b1699b4ed21158197b7 after the agent is initialized.
    [MonAgentHost] Output: Registered as an event consumer.
    [MonAgentHost] Output: Agent will exit when parent process 7924 exits.
    [MonAgentHost] Output: Monitoring Agent Started
    [Diagnostics]: Error when updating configuration:System.UnauthorizedAccessException: Access to the path is denied.
       at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
       at System.IO.Pipes.NamedPipeServerStream.Create(String fullPipeName, PipeDirection direction, Int32 maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, Int32 inBufferSize, Int32 outBufferSize, PipeAccessRights rights, SECURITY_ATTRIBUTES secAttrs)
       at System.IO.Pipes.NamedPipeServerStream..ctor(String pipeName, PipeDirection direction, Int32 maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options, Int32 inBufferSize, Int32 outBufferSize, PipeSecurity pipeSecurity, HandleInheritability inheritability, PipeAccessRights additionalAccessRights)
       at System.IO.Pipes.NamedPipeServerStream..ctor(String pipeName, PipeDirection direction, Int32 maxNumberOfServerInstances, PipeTransmissionMode transmissionMode, PipeOptions options)
       at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.StartDiagnosticsMonitorProcess(DiagnosticMonitorStartupInfo info)
       at Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitor.ReconfigureMonitoringProcess(ConfigRequest req)
       at Microsoft.WindowsAzure.Diagnostics.ControlChannel.UpdateConfigRequest(Func`2 f)
    [Diagnostics] Information: C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor
    [Diagnostics] Information: C:\Projects\Liveracers\LiveRacersMVC\LiveRacersMVC\LiveRacersAzure\csx\Debug\roles\LiveRacers.Web\diagnostics\x64\monitor\MonAgentHost.exe -LocalPath "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor" -StaticConfigFile "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor\Configuration\mastaticconfig.xml" -ConfigFile "C:\Users\Stevo\AppData\Local\dftmp\Resources\1b9b7647-9761-4015-9f20-b752651d10ca\directory\DiagnosticStore\Monitor\Configuration\maconfig.xml" -ShutDownEvent WADDM-ShutDown-dface6f0dafb4119aeda12de2462f2dd -InitializedEvent WADM-StartUp-dface6f0dafb4119aeda12de2462f2dd -parent 7924 -events
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:51.845Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:51.845Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:51.845Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:51.845Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:51.845Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:51.845Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    [MonAgentHost] Error: MA EVENT: 2012-03-24T23:35:51.845Z
    [MonAgentHost] Error:     3
    [MonAgentHost] Error:     7896
    [MonAgentHost] Error:     6632
    [MonAgentHost] Error:     EtwListener
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     x:\btsdx\215\services\monitoring\agent\dll\etw.cpp
    [MonAgentHost] Error:     EtwListener::EventConsumer
    [MonAgentHost] Error:     2023
    [MonAgentHost] Error:     0
    [MonAgentHost] Error:     1069
    [MonAgentHost] Error:     The instance name passed was not recognized as valid by a WMI data provider.
    [MonAgentHost] Error:     Error: ProcessTrace failed, sessionname=MA_ETWSESSION_STEVO-PC3_deployment16(61).LiveRacersAzure.LiveRacers.Web_IN_0
    ...

    Please help, I've no idea what is broken, but neitheir the loggin, not the copying to local storage is working

    Stevo







    • Edited by Stevo Zilik Saturday, March 24, 2012 11:41 PM
    Saturday, March 24, 2012 11:39 PM

Answers

  • Hi Sandrino,

    thanks for reply. I have Logging Level set to Verbose. What I'm worried about is why I get so many errors in the console window, it's generation many rows of errors per second.

    Edit: after rebooting my PC, the problem fixed itself. Not sure what it caused..

    Sunday, March 25, 2012 12:21 PM

All replies

  • Hi Stevo,

    When you develop locally and want to output the trace logs in the emulator you can also add the listener for the emulator (remove this when you deploy to Azure):

    <system.diagnostics>
        <trace>
          <listeners>
            <add type="Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureDiagnostics">
              <filter type="" />
            </add>
    	<add type="Microsoft.ServiceHosting.Tools.DevelopmentFabric.Runtime.DevelopmentFabricTraceListener, Microsoft.ServiceHosting.Tools.DevelopmentFabric.Runtime, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" name="AzureEmulator">
    	  <filter type="" />
            </add>
          </listeners>
        </trace>
    </system.diagnostics>

    Also, if you want to display a level below information you'll need to adapt the output of the emulator by clicking on the (I) icon:

    Hope this helps,

    Sandrino


    Sandrino Di Mattia | Twitter: http://twitter.com/sandrinodm | Azure Blog: http://fabriccontroller.net/blog | Blog: http://sandrinodimattia.net/blog

    Sunday, March 25, 2012 6:58 AM
  • Hi Sandrino,

    thanks for reply. I have Logging Level set to Verbose. What I'm worried about is why I get so many errors in the console window, it's generation many rows of errors per second.

    Edit: after rebooting my PC, the problem fixed itself. Not sure what it caused..

    Sunday, March 25, 2012 12:21 PM
  • Hi,

      >> Edit: after rebooting my PC, the problem fixed itself. Not sure what it caused..

    I'm glad to hear that you resolve this issue.

    In addition, I searched "The instance name passed was not recognized as valid by a WMI data provider.", and found some results that may help:
    http://social.technet.microsoft.com/Forums/en-US/w7itprosecurity/thread/95987ca3-a1b2-4da6-95b7-d825d06cdac7/
    http://social.technet.microsoft.com/Forums/en/itprovistaapps/thread/8b90aa53-af83-4e0d-9b48-6f8914166bb0
    http://social.msdn.microsoft.com/Forums/en-US/windowscompatibility/thread/c75ae899-d05b-411d-a7f2-00fdd33b8589

    Best Regards,

    Ming Xu.


    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework

    Sunday, March 25, 2012 4:20 PM
    Moderator