- The Azure Storage Explorer but when your logs are too big you will just have a OutOfMemeryException
- The SCLA (Sitecore Log Analyser) you need to uncomment something in the web.config to activate the Azure possibility. But again when you will have big logs it will be not usable anymore.
- Visual Studio. If you go to the server explorer, then on Azure, then Storage, Tables, and click on the WADLogsTable. As a limitation you will not be able to retrieve more than 10000 records.
- This LinqPad with the Azure Table Storage Driver. I will explain this possibility more in details below.
string.Format("0{0}", (new DateTime(2015, 02, 26)).Ticks)If you want more details the following article explain it in details: http://gauravmantri.com/2012/02/17/effective-way-of-fetching-diagnostics-data-from-windows-azure-diagnostics-table-hint-use-partitionkey/ By using this trick you are able to build and execute a query on the PartitionKey by using Visual Studio but, as I said, you are limited to 10000 records max.
If you need to retrieve all the records of a single day one of the solution is LinqPad. To be able to query those table you need to:
- Download Azure Table Storage Driver
- Install this driver by:
- Open LinqPad
- Click on "Add connection"
- Click on "View more drivers..."
- Click on browse and select your lpx file
- Click on close
(from l in WADLogsTable where l.PartitionKey.CompareTo(new DateTime(2015, 02, 13, 0,0,0).Ticks.ToString("d19")) > 0 && l.PartitionKey.CompareTo(new DateTime(2015, 02, 14, 0, 0, 0).Ticks.ToString("d19")) < 0 select new { DateTime = new DateTime(l.EventTickCount.Value), l.Message, l.Level }).ToList().Dump();But as you see LinqPad is also limited to 1000 records because of the azure storage api. the workaround for it is to execute the request hour by hour in a loop like this:
for(int i = 0; i < 24; i++) { (from l in WADLogsTable where l.PartitionKey.CompareTo(new DateTime(2015, 02, 13, i,0,0).Ticks.ToString("d19")) > 0 && l.PartitionKey.CompareTo(new DateTime(2015, 02, 13, i+1, 0, 0).Ticks.ToString("d19")) < 0 select new { DateTime = new DateTime(l.EventTickCount.Value), l.Message, l.Level }).ToList().Dump(); }
No comments:
Post a Comment