WCF tracing in Azure production

拈花ヽ惹草 提交于 2019-12-25 05:19:26

问题


How do I set WCF tracing in Azure (production environment) so that I'll have logging of all WCF errors?


回答1:


Can't you use Windows Azure Diagnostics for this purpose? Once it is properly configured, your trace logs will be available in a Windows Azure Storage account that you have specified in your code. More information about Windows Azure Diagnostics can be found here: https://www.windowsazure.com/en-us/develop/net/common-tasks/diagnostics/.




回答2:


Just like Guarav said, you can simply use the Azure diagnostics to log all errors to your storage account (there's a good read in the MSDN Magazine: Take Control of Logging and Tracing in Windows Azure).

Now I personally don't like the 'flat' logging when working with WCF. I find it very important to be able to trace through activities. That's why for all Azure projects where I use WCF I don't use the normal diagnostics.

I use a trick documented by Christian Weyer where I log to a classic *.svclog file and have those files shipped to my storage account. Then I use the CloudBerry Storage Explorer to simply view those logs that include the activites. This is possible by creating a custom XmlWriterTraceListener that writes to a local resource which is shipped to your storage account.



来源:https://stackoverflow.com/questions/11608024/wcf-tracing-in-azure-production

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!