Accessing Windows Azure Diagnostics Logs With LINQPad

If you are using Windows Azure Diagnostics with the DiagnosticMonitorTraceListener you will most likely have a table in your storage account called WADLogsTable with a ton of data in it. It can be a bit overwhelming.

A colleague and I wanted to get two simple pieces of information: an event’s date and the corresponding message. Furthermore, we only wanted events that had happened today. Here’s what we came up with using LINQPad and the Azure Storage Driver.

First, make sure you’re using a table storage account as your database. In my case, my connection is called mycloudstorageaccount.

Then simply perform your query. If you want to copy/paste, here’s the text version:

from l in WADLogsTable
where l.PartitionKey.CompareTo(DateTime.Today.Ticks.ToString("d19")) > 0
select new
{
	DateTime = new DateTime(l.EventTickCount.Value),
	l.Message
}

Oh, and don’t forget to check out the SQL tab if you are interested in the « low level stuff. » It will show the actual URL that was used to query Windows Azure.

4 réflexions sur “Accessing Windows Azure Diagnostics Logs With LINQPad

  1. Hello, I could not access the local WADLog table. I have
    – wadlogs table with log entries (Azure Management Studio shows them).
    – storage account is correct because the Tables part is appears in LinqPad
    – Im using the Azure Storage Driver of course
    – but I get the following
    The name ‘WADLogsTable’ does not exist in the current context

    Do I need something additional to access the Diagnostic part besides the Tables ?
    Thanks in advance.

    Comp.

  2. Hello Diaz,

    Since then I noticed that, LinqPad doesn’t shows the ‘WADLogsTable’ in the table list, but its exists according to Azure Storage Management Studio. Did you have the same situation as well ?

  3. Hi, the plugin uses the Azure SDK to query all tables for the specified account. It does not filter them in any way. I don’t currently have access to an account that uses Azure Diagnostics so I cannot it try it myself. Does the plugin show all other tables present in the account?

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s