Windows Azure Auto Scale Application Block does not work and does not print log messages

181 Views Asked by At

I had implemented the Windows Azure Auto Scale Application Block in console application which monitor the performance counters and add the instances to the web role. I implemented the logging also but it does not show me the logs in the console and it does not adding the new instances to the web role based on rules.

And it is not giving me any error...

1

There are 1 best solutions below

0
On

Without knowing how the application is configured (in particular the content of app.config and of the schedule file), the best educated guess I can make is that your app.config is missing the configuration in <system.diagnostics> to enable the logging of messages from the block.

In short, in your app.config you should have a section similar to the following (taken from one of my sample applications):

<system.diagnostics>
  <trace autoflush="true" />
    <sources>
      <source name="Autoscaling General" switchName="SourceSwitch" switchType="System.Diagnostics.SourceSwitch">
        <listeners>
          <add name="FileLog"/>
          <remove name="Default" />
          <!-- Uncomment the below section to write to the Application Event Log -->
          <!--<add name="EventLog"/>-->
        </listeners>
      </source>
      <source name="Autoscaling Updates" switchName="SourceSwitch" switchType="System.Diagnostics.SourceSwitch">
        <listeners>
          <add name="FileLog"/>
          <remove name="Default" />
          <!-- Uncomment the below section to write to the Application Event Log -->
          <!--<add name="EventLog"/>-->
        </listeners>
      </source>
        <!-- This section defines the logging configuration for My.Application.Log -->
        <source name="DefaultSource" switchName="DefaultSwitch">
            <listeners>
                <add name="FileLog"/>
                <!-- Uncomment the below section to write to the Application Event Log -->
                <!--<add name="EventLog"/>-->
            </listeners>
        </source>
    </sources>
    <switches>
        <add name="DefaultSwitch" value="Information"/>
      <add name="SourceSwitch" value="Verbose, Information, Warning, Error, Critical"/>
    </switches>
    <sharedListeners>
        <add name="FileLog" type="Microsoft.VisualBasic.Logging.FileLogTraceListener, Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" initializeData="FileLogWriter" location="ExecutableDirectory"/>

        <!-- Uncomment the below section and replace APPLICATION_NAME with the name of your application to write to the Application Event Log -->
        <!--<add name="EventLog" type="System.Diagnostics.EventLogTraceListener" initializeData="APPLICATION_NAME"/> -->
    </sharedListeners>
</system.diagnostics>

You can find further information from MSDN.

In addition to his, I recall that I had to set some breakpoints (on Autoscaler.Start if I remind correctly) in order to catch some configuration errors.