Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OaaS/HeuristicLab.Services.Optimization.Web/WebRole.cs @ 13791

Last change on this file since 13791 was 9576, checked in by spimming, 12 years ago

#1888:

  • Added billing test client
  • Use entity framework for DAL
  • Modified service interface and model classes
File size: 1.4 KB
Line 
1using System;
2using Microsoft.WindowsAzure.Diagnostics;
3using Microsoft.WindowsAzure.ServiceRuntime;
4
5namespace HeuristicLab.Services.Optimization.Web {
6  public static class Constants {
7    public const string DiagnosticsConnectionString = "Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString";
8  }
9
10  public class WebRole : RoleEntryPoint {
11    public override bool OnStart() {
12      // For information on handling configuration changes
13      // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.     
14      try {
15        if (!String.IsNullOrEmpty(RoleEnvironment.GetConfigurationSettingValue(Constants.DiagnosticsConnectionString))) {
16          DiagnosticMonitorConfiguration dmc = DiagnosticMonitor.GetDefaultInitialConfiguration();
17          dmc.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1);
18          dmc.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose;
19          DiagnosticMonitor.Start(Constants.DiagnosticsConnectionString, dmc);
20        }
21      }
22      catch (RoleEnvironmentException) {
23        // diagnostics connection string not in configuration
24        // -> diagnostics disabled
25        // nothing more to do
26      }
27
28      RoleEnvironment.Changed += RoleEnvironmentChanged;
29
30      return base.OnStart();
31    }
32
33    private void RoleEnvironmentChanged(object sender, RoleEnvironmentChangedEventArgs e) {
34    }
35  }
36}
Note: See TracBrowser for help on using the repository browser.