7
votes

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.

3
I found this link to be very helpful: msdn.microsoft.com/en-us/magazine/ff714589.aspxpritaeas

3 Answers

9
votes

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.

1
votes
0
votes

I wrote a tool that allows you to view Azure Diagnostic information.. check it out

AzTools - Azure Diagnostic Viewer

Click here to see how you could use this tool