locked
Can I access WAD local storage data directly from web role instance? RRS feed

  • Question

  • Internally WAD stores the logs into Local Storage first and then we can write scheduler to transfer these logs to Windows Azure Storage.

    But is there any way to read logs directly from WAD local storage and display it on a web page of web role instance, without transferring logs to Azure Storage account? 

     

    Thanks,

    Priyanka

    Thursday, June 23, 2011 8:42 AM

Answers

  • Hi Priyanka,

    > Internally WAD stores the logs into Local Storage first and then we can write scheduler to transfer these logs to Windows Azure Storage.

    The name of the local storage that WAD uses to store log files is "DiagnosticStore". We can use the following code to get the root path of that folder:

    RoleEnvironment.GetLocalResource("DiagnosticStore").RootPath

    But these files are encoded so you may need to learn how DiagnosticMonitor (which is not open source) parses these files. Otherwise, even though you can access these data files, you are not able to display them in a web page.

    Please don't mind to submit a feature request:

    http://www.mygreatwindowsazureidea.com

    Thanks,

     


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Priyankad Wednesday, June 29, 2011 2:33 PM
    Friday, June 24, 2011 8:18 AM

All replies

  • Hi Priyanka,

    Even I had to do the same thing, looks like that thing cannot be done. Without the Table Storage you cannot the access WAD Data

    I posted the same in Stack overflow and please refer it

    http://bit.ly/l4tP5s 

     

    Regards

    Naveen Kumar V


    Naveen Kumar
    • Proposed as answer by navcode Thursday, June 23, 2011 9:44 AM
    Thursday, June 23, 2011 9:43 AM
  • Hi Priyanka,

    > Internally WAD stores the logs into Local Storage first and then we can write scheduler to transfer these logs to Windows Azure Storage.

    The name of the local storage that WAD uses to store log files is "DiagnosticStore". We can use the following code to get the root path of that folder:

    RoleEnvironment.GetLocalResource("DiagnosticStore").RootPath

    But these files are encoded so you may need to learn how DiagnosticMonitor (which is not open source) parses these files. Otherwise, even though you can access these data files, you are not able to display them in a web page.

    Please don't mind to submit a feature request:

    http://www.mygreatwindowsazureidea.com

    Thanks,

     


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    • Marked as answer by Priyankad Wednesday, June 29, 2011 2:33 PM
    Friday, June 24, 2011 8:18 AM
  • Hi Wengchao & Naveen,

    Thanks for the immediate reply. After searching on internet I was aware that we cannot read WAD log files directly from Local Storage but wanted to confirm it once.

    One more question, is it possible to transfer these WAD logs to SQL azure tables instead of azure storage?

    Thanks,

    Priyanka

    Friday, June 24, 2011 9:40 AM
  • Here is something on the same note,

    I agree that, files that are prepared by WAD are encoded. But how about using Windows API's that are already available to access event logs, performance counters etc. directly instead of DiagnosticsMonitor. Some of the advantages I see from this approach are,

    1. Existing API may have more methods than that WAD API provides to interact with mosf of these data sources. Are are any limitations for default account that roles run under to access these APIs?

    2. Most current status of role instances could be retrieved by reading data directly from respective sources on running instances using a common service hosted for this purpose.

    3. Storage costs could be saved at least upto some extent.

    I do agree that, this would not be appropriate for cases like persisting historic diagnostic information as state of role instance would not be available upon re-provision or restart upon patches etc.

    Any thougths??

     


    Please mark it as answer by clicking on "Propose As Answer", if it helps. My Blog : http://dotnetizen.blogspot.com
    Friday, June 24, 2011 12:14 PM
  • Hi Rajesh,

    Are you saying instead of using WAD we can use windows API's to collect the logging data on local storage. And then we can use same API's to read the data from Local Storage?

     

    If that is the case I would love to implement that. Do you have any references explaining the same in detail ?

     

    Thanks,

    Priyanka

    Monday, June 27, 2011 10:28 AM
  • Hi Priyanka,

    > Are you saying instead of using WAD we can use windows API's to collect the logging data on local storage. And then we can use same API's to read the data from Local Storage?

    WAD works like an agent that collects logs from the sources to local storage and finally tranfers them to Azure Storage. I think Rajesh meant to bypass WAD and read logs directly from the sources.

    For instances:

    IIS Logging Overview

    How to: Read Event Log Entries

    Thanks.


    Wengchao Zeng
    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
    Wednesday, June 29, 2011 3:55 AM
  • I did see some of our on-premise applications programatically read event log entries and performance counters using Windows/ WMI API. If there are no constraints exist on Azure role to use these API's, then I dont see why we cant use this approach wherever this can be applicable (saving storage costs, access to realtime monitoring information,extensive API than WAD etc.).

    I would like to hear from others and see if there are any odds involved with this approach that I might not have thought about. 

    If anyone is interested to try and see how this really looks ,  I am happy to join and contribute to a community project using some open source platform like codeplex.


    Please mark it as answer by clicking on "Propose As Answer", if it helps. My Blog : http://dotnetizen.blogspot.com
    Wednesday, June 29, 2011 4:48 AM
  • I did see some of our on-premise applications programatically read event log entries and performance counters using Windows/ WMI API. If there are no constraints exist on Azure role to use these API's, then I dont see why we cant use this approach wherever this can be applicable (saving storage costs, access to realtime monitoring information,extensive API than WAD etc.).

    I would like to hear from others and see if there are any odds involved with this approach that I might not have thought about. 

    If anyone is interested to try and see how this really looks ,  I am happy to join and contribute to a community project using some open source platform like codeplex.


    Please mark it as answer by clicking on "Propose As Answer", if it helps. My Blog : http://dotnetizen.blogspot.com

    I agree with you Rajesh. If there is a way to collect these logs without WAD then that option should be preferred first as it will save the cost. 

    But the problem is Local Storage logs are not reliable and you will lose these logs whenever your role crashes or recycles. Another problem is if your application is running on multiple VM's then how will you collect data from multiple Local Storages to single location? I think this collection of data will also involve some cost.

    So it seems that lot of work is involved in this approach. Do let me know if you hear anything on this front.  In the mean time I will try to implement this as I get time from usual work.

    Thanks Rajesh for your time. 

    Wednesday, June 29, 2011 2:32 PM
  • Thanks Wengcho for your valuable inputs. 
    Wednesday, June 29, 2011 2:33 PM