Sitecore Azure PaaS – View Logs & access VM

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:

Azure-blob-storage-explorer

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:

azure-portal-rdp-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:

  1. Copy the <log4net> section from a vanilla (fresh) Sitecore installation and replace the existing <log4nt> section on the Azure VM with this.
  2. sitecore-log-4-net-default
  3. Then locate the ~/app_data/logs/ folder and view the logs in txt files
  4. And it’s easiest to use a tool like WinTail that shows the latest entries into the log as they happen.

sitecore-logs-wintail

Summary

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)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>