Answered Customize RowKey data in WADLogsTable

  • Friday, March 02, 2012 12:19 AM
     
     

    I am using Trace.TraceError(message) to add to WADLogsTable. At the same time i need to passback a GUID or some unique string to the user so that user can send us that GUID for investigation. I can generate a GUID and concatenate to 'message' parameter for Trace.TraceError(message) and send back the Guid to the user. But then error search-ability by GUID reduced significantly.

    My question is: Is there a way to add custom data to one of the columns of WADLogsTable, e,g. RowKey?

    If not, how can we get the RowKey back after entering the error to WADLogsTable? That can serve as my GUID too.

    Thanks

    Kazi


    • Edited by azuredev11 Friday, March 02, 2012 12:23 AM
    •  

All Replies

  • Friday, March 02, 2012 12:53 AM
     
     

    One alternate is to write directly to the WADLogsTable yourself, but that really defeats the purpose.

    A better solution would be to design a table specifically for your exact needs and use that for user specific logging.

    Added. 
    You could use the user id as the PartitionKey and a guid+timestamp for the RowKey for logging every event and making it easily searchable both by user and by the user+guid. 
    • Edited by Lucifure Friday, March 02, 2012 9:43 PM Clarification
    •  
  • Friday, March 02, 2012 1:09 AM
     
     

     One option could be to use the WADLogsTable RowKey itself, I think it should solve the purpose of being unique and identify a row.

  • Friday, March 02, 2012 7:25 PM
     
     
    How do I get the RowKey immediately after adding to WADLogsTable?
  • Monday, March 05, 2012 7:00 AM
    Moderator
     
     Answered

    Hi,

    When you try to insert a entity into Table Storage, you need assign a value to RowKey property, why not get that value before inserting?

    If you want to make the entity has been inserted into table storage, try to make a simple query to check it with unique column (such as RowKey).

    Thanks.


    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