Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to view azure diagnostics Log

I am not able to find out how to see azure diagnostics logs. Code which I wrote is as follows.

DiagnosticMonitorConfiguration config = iagnosticMonitor.GetDefaultInitialConfiguration();
System.Diagnostics.Trace.Listeners.Add(new Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener());
config.Logs.ScheduledTransferLogLevelFilter = LogLevel.Information;
config.WindowsEventLog.ScheduledTransferPeriod = System.TimeSpan.FromMinutes(1.0);
DiagnosticMonitor.Start("Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString", config);

then I added Trace.WriteLine("some message"); in the code. Now where do I find those messages. I checked in Visual Studio server explorer, where I added my storage account reference. wad-control-container has only config files.

like image 272
Pavan Avatar asked May 08 '12 08:05

Pavan


1 Answers

You might want to take a look at this blog post by Michael S. Collier. A setting in your cloud project might cause the logs to end up in an other place than you would expect them to:

http://michaelcollier.wordpress.com/2012/04/02/where-is-my-windows-azure-diagnostics-data/

Update:

Note that you'll have to take care of every small detail to make everything work.

Where are you writing Trace.WriteLine("some message"); ? Is it in your WebRole.cs? If that's the case, you'll need to configure the trace listener for the WebRole.cs (this runs in an other process, different than your actual web application).

Here is an example how you can set up the trace listener in the WebRole.cs class:

System.Diagnostics.Trace.Listeners.Add(new Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener());
System.Diagnostics.Trace.AutoFlush = true;

After setting that up, you can use Trace.WriteLine.

like image 127
Sandrino Di Mattia Avatar answered Oct 07 '22 13:10

Sandrino Di Mattia