DiagnosticMonitor in Azure Web Site
Asked Answered
B

2

5

Can you use the Azure DiagnosticMonitor in an Azure Web Site (not a web role) ? Or does it need a compute role?

Barbuto answered 17/9, 2012 at 10:16 Comment(0)
U
4

No, You can't use Windows Azure Diagnostics (DiagnosticsMonitor) in an Azure Website. You would need to use a compute role for that.

Unwarranted answered 17/9, 2012 at 10:23 Comment(4)
Ok thanks. Do you have any recommendations for trace message logging ? A custom traceappender that writes straight to the Table service maybe ?Barbuto
Do take a look at these blog posts - blog.smarx.com/posts/… & wadewegner.com/2011/08/….Unwarranted
Thanks Guarav, ill probably go with something similar (log4net -> table) but was a little worried about performance.Barbuto
Don't log to tables in anything other than a demo app. You block a process to wait for an IO bound call to write to table storage and your app crashes when storage times out (it does). That is terrible for scalability. Use a trace listener or logging framework that knows how to write in a non-blocking manner.Caroleecarolin
M
5

No,

Azure DiagnosticsMonitor is only for Web/Worker Roles. Diagnostic in Azure WebSite is common as for any web application. As Azure WebSites use persistent storage, you can safely write a log file (having in mind you are using multi-threaded environment like in any ASP.NET/or any web application). More, you can configure additional diagnostics options in the "Configure" tab of the WebSite:

Azure WebSites Diagnostics

You can turn on Detailed Error Messages + Failed Request Tracing. You can download the Failed Request logs from the FTP server of your site.

You can use log4net for detailed error/trace logging in your web application (if it is ASP.NET). Some tutorial here.

Maturate answered 17/9, 2012 at 10:27 Comment(4)
Isnt persistent storage VM specific ? Im interested in collecting custom trace messages from my app in a central locationBarbuto
persistent storage is VM + WebSites specific. Your Azure WebSite (not WebRole, but WebSite) uses persistent storage and it is absolutely safe to use the storage provided with it. Note that the storage for WebSites is 1 Gb. If you need more - than you have to think about Blobs.Maturate
Using log4net and textfileappender with > 1 web site instance id have multiple physical logs ?Barbuto
@astaykov, please clarify your answer: if we have an Azure web site scaled to 10 VM instances, are the logs aggregated (for the web site as a whole) or are they separate per VM and stored in each VM?Locative
U
4

No, You can't use Windows Azure Diagnostics (DiagnosticsMonitor) in an Azure Website. You would need to use a compute role for that.

Unwarranted answered 17/9, 2012 at 10:23 Comment(4)
Ok thanks. Do you have any recommendations for trace message logging ? A custom traceappender that writes straight to the Table service maybe ?Barbuto
Do take a look at these blog posts - blog.smarx.com/posts/… & wadewegner.com/2011/08/….Unwarranted
Thanks Guarav, ill probably go with something similar (log4net -> table) but was a little worried about performance.Barbuto
Don't log to tables in anything other than a demo app. You block a process to wait for an IO bound call to write to table storage and your app crashes when storage times out (it does). That is terrible for scalability. Use a trace listener or logging framework that knows how to write in a non-blocking manner.Caroleecarolin

© 2022 - 2024 — McMap. All rights reserved.