Developing locally for Azure deployment covers most scenarios, but being able to view the Authoring environment and Delivery environment logs is imperative – particularly when deploying new releases.
By default Sitecore Azure changes the logging to the Azure data storage and this can be examined via the Azure Storage explorer. The setting for this can be seen in the MS Azure portal, see the following screen shots:
However it is really difficult (and a bit slow) to view the logs using this. It has been found easier to actually access the PaaS VM using RDP. This can be configured using the Azure portal. [Cloud Services tab on left] -> [Instances tab] -> [Instance] -> connect (see below). And this needs to first be enabled / setup on the Remote tab for the Cloud service:
Once you have remote desktop connection to the VM, it is possible to view the IIS logs etc. But importantly it is possible to change the <Log4Net> configuration to save the files to the file system for easy viewing. To do this:
- Copy the <log4net> section from a vanilla (fresh) Sitecore installation and replace the existing <log4nt> section on the Azure VM with this.
- Then locate the ~/app_data/logs/ folder and view the logs in txt files
- And it’s easiest to use a tool like WinTail that shows the latest entries into the log as they happen.
It is more often than not imperative to be able to RDP into the VM’s created by the Sitecore Azure Platform-As-A-Service. These VMs are created dynamically by Sitecore, but for trouble shooting / development we often need to RDP into the actual Cloud Service Instances (virtual machines)