View Azure cloud service IIS logs

大兔子大兔子 提交于 2019-12-11 03:54:23

问题


I have created a simple MVC3 site that displays data from a table in an Azure database. I have created a cloud service to run the site in and can publish it successfully. I have also run the site successfully in the Azure emulator.

My problem is that when I select the page that displays the data there is an error as I get the default error page. I think I have the db connections set correctly but I cannot see any logs. So my questions are:

  • Where are the IIS logs? I would like to see what the error is.
  • Are there any other logs/diagnostics that I can use to see what the problem is?

Thanks.


回答1:


I suggest you use Windows Azure Diagnostics to collect your logs.

You can read all(setup and usage) about it here: http://msdn.microsoft.com/en-us/library/windowsazure/gg433048.aspx




回答2:


By default the only place where something might be logged is in the Windows Application Event Log. You'll need to Remote Desktop to the cloud service instance (Connect from the Instances page in the Azure Management Portal) and then open Event Viewer.

The IIS logs themselves should be available too although as per normal IIS logs these won't contain exception details. Use IIS Manager > Application > Logging when logged on to the instance to find the location.

As suggested by Magnus, you should use something like Windows Azure Diagnostics and/or ELMAH and/or log4net to log exception and diagnostic information to somewhere accessible for troubleshooting.



来源:https://stackoverflow.com/questions/13131430/view-azure-cloud-service-iis-logs

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