Reputation: 2433
I would like to log every exception that occurs, (MVC cloudapp), in my table storage.
I followed an official tutorial from Microsoft but it seems like they just complicate things too much. Tutorial can be viewed here: https://azure.microsoft.com/sv-se/documentation/articles/cloud-services-dotnet-diagnostics/#how-to-enable-diagnostics-in-a-worker-role
It just feels like it's too much of a hassle just because Azure diagnostics 1.3 isn't supported by default? There's a faster and easier option in the configure window for web/worker role that let's you enable diagnostics but is that only for 1.0?
I just want to log the exceptions in my storage account so Azure Diagnostics 1.0 should be enough, no?
What I've done:
What I need help with:
No WAD containers are created in my storage account. Are they not supposed to be created after I have enabled and specified the storage account credentials?
Why is it so complicated to enable Azure diagnostics 1.3 compared to 1.0?
What's the difference between worker role diagnostics and web role diagnostics? If I had my app in webrole and caching in worker role.. Is it then logged individually? Do I need to enable them both if I want exception logging for both app and caching?
Upvotes: 1
Views: 2060
Reputation: 111
There's a simple PowerShell script on GitHub to enable WAD on either a Cloud Service (Web/Worker Role) or a VM with zero hassle. At the same time it will also configure WAD to send your logs to Visual Studio Application Insights so you can search & query efficiently.
Upvotes: 2
Reputation: 136346
To answer your questions:
No WAD containers are created in my storage account. Are they not supposed to be created after I have enabled and specified the storage account credentials?
If you're looking for wad-control-container
, then it won't be created. However you should see containers for IIS Logs, Failed Request Logs and Crash dumps if you have enabled that in your diagnostics configuration.
Why is it so complicated to enable Azure diagnostics 1.3 compared to 1.0?
Essentially the diagnostics model has changed. Version 1.0 was plugin model while Version 1.3 is an extension model (It changed from SDK 2.5 when they introduced version 1.2). Whether it is complicated, I think it is debatable. While 1.0 version was rather straight forward and had some capabilities like definining the diagnostics configuration in code, I think 1.3 is a step in right direction. I too felt frustrated with it to begin with but now I am realizing the benefits it offers as I use it more. Some of the benefits that appealed to me are:
Some of the things that I don't like in 1.3:
On-Demand Transfer
functionality. We use this functionality a lot which is now deprecated as it relies on code-based diagnostics changes.What's the difference between worker role diagnostics and web role diagnostics?
AFAIK, there's no difference between the two. It all depends on what diagnostics data you want to collect for each role.
If I had my app in webrole and caching in worker role. Is it then logged individually?
Well, yes and no. Each role get it's own diagnostics.wadcfgx
file where you define the storage account to store diagnostics data. If you define different storage accounts in each role's wadcfgx
file then the data would go into separate storage account. Even if you keep the same storage account, data will have the role name
and role instance name
so that you can distinguish between different diagnostics data.
Do I need to enable them both if I want exception logging for both app and caching?
Yes. You would need to enable them both.
Upvotes: 2