Changeset 9215 for branches/OaaS/HeuristicLab.Services.Hive.WebRole
- Timestamp:
- 02/11/13 10:15:52 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OaaS/HeuristicLab.Services.Hive.WebRole/WebRole.cs
r8235 r9215 24 24 using Microsoft.WindowsAzure.Diagnostics; 25 25 using Microsoft.WindowsAzure.ServiceRuntime; 26 using System.Diagnostics; 26 27 27 28 namespace HeuristicLab.Services.Hive.WebRole { … … 31 32 32 33 public override bool OnStart() { 34 Trace.WriteLine("Starting Janitor Service..."); 35 try { 36 DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration(); 37 /*diagnosticConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); 38 diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory());*/ 39 diagnosticConfig.Logs.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); 40 diagnosticConfig.Logs.ScheduledTransferLogLevelFilter = LogLevel.Verbose; 41 diagnosticConfig.WindowsEventLog.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); 42 diagnosticConfig.WindowsEventLog.ScheduledTransferLogLevelFilter = LogLevel.Verbose; 43 DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", diagnosticConfig); 44 } 45 catch (Exception e) { 46 Trace.WriteLine("Error during diagnostic configuration: " + e.Message); 47 } 48 33 49 // To enable the AzureLocalStorageTraceListner, uncomment relevent section in the web.config 34 DiagnosticMonitorConfiguration diagnosticConfig = DiagnosticMonitor.GetDefaultInitialConfiguration(); 35 diagnosticConfig.Directories.ScheduledTransferPeriod = TimeSpan.FromMinutes(1); 36 diagnosticConfig.Directories.DataSources.Add(AzureLocalStorageTraceListener.GetLogDirectory()); 37 50 51 Trace.WriteLine("Loading diagnostic configuration..."); 52 38 53 // For information on handling configuration changes 39 54 // see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357. 40 55 41 56 // Start Janitorn Service: 42 janitor = new HiveJanitor(); 43 janitorThread = new Thread(janitor.Run); 44 janitorThread.IsBackground = true; //dont keep app alive 45 janitorThread.Start(); 46 57 Trace.WriteLine("Starting HiveJanitor..."); 58 try { 59 janitor = new HiveJanitor(); 60 janitorThread = new Thread(janitor.Run); 61 janitorThread.IsBackground = true; //dont keep app alive 62 janitorThread.Start(); 63 } 64 catch (Exception e) { 65 Trace.WriteLine("Error during janitor startup: " + e.Message); 66 } 67 Trace.WriteLine("Startup completed..."); 47 68 return base.OnStart(); 48 69 } … … 51 72 janitor.StopJanitor(); 52 73 janitorThread.Join(); 53 54 74 base.OnStop(); 55 75 }
Note: See TracChangeset
for help on using the changeset viewer.