10

Currently, We are on Sitecore PaaS. There are some issues and we are not able to find out the root cause of those issues. We tried to find out some clues in Sitecore log file but We noticed that there is no log file in the directory /site/wwwroot/App_Data/logs

I also tried with Sitecore client interface to load log file, but even there, i didn't get any log file.

Any thoughts or idea, where I can find it or is it something we need to setup?

16

Accessing Sitecore XP logs and diagnostics information on Azure Web Apps differs from the on-premise approach. This article explains how to collect basic Sitecore diagnostics information, such as logs and configuration data, for a Sitecore XP solution deployed to Azure Web Apps.

To access enhanced logging data of a Sitecore XP instance deployed to Azure Web Apps, it is recommended to browse preconfigured AppInsights records using AppInsights Analytics Portal:

  1. Go to Azure Portal (https://portal.azure.com).

  2. Select the specific Application Insights object related to Sitecore XP deployment.

  3. In the Overview section, click the Analytics tab at the top of the page. On the AppInsights Analytics Portal page, create a new tab and enter the relevant query to the Sitecore logs storage:
traces
| where cloud_RoleInstance == 'CloudRole'
| where timestamp > now(-14d)
| project timestamp, message
| sort by timestamp desc
The "CloudRole" value for the needed instance (CM, CD, Processing, Reporting, Single) can be determined using the following query:

traces
| extend scinstancename=parsejson(customDimensions).InstanceName
| where timestamp > now(-1d)
| summarize count(), any(tostring(scinstancename)) by cloud_RoleInstance
| extend InstanceName=any_scinstancename
| extend CloudRole=cloud_RoleInstance
| project InstanceName, CloudRole
| order by InstanceName asc

InstanceName — a self-descriptive name of a solution

CloudRole — a name of a cloud role. Each scaled-out instance is associated with several cloud roles containing their own logs.

After logs are retrieved, they can by exported to a CSV file.

For more details about writing custom queries, use the analytics query reference from Microsoft Azure documentation.

More informations you can find at:

https://doc.sitecore.net/sitecore_experience_platform/setting_up_and_maintaining/sitecore_on_azure/analytics/analyze_sitecore_logs_with_application_insights

https://kb.sitecore.net/articles/911837

Update Is possible to Enable logstream on Azure app service.

enter image description here

https://docs.microsoft.com/en-us/azure/app-service/web-sites-enable-diagnostic-log

  • 2
    Thank you for the response. I was able to figure it out by navigating to my webapp in azure portal under "Diagnostic Logs" and Turn "ON" the "Application Logging(Filesystem)". After doing this I went to "Log Stream" where I am now able to see the Errors on my Sitecore Website. – Jovit Mayo Jan 16 '18 at 9:11
  • Yep LogStream are really usefull, I will update the answer with Logstream – Vlad Iobagiu Jan 16 '18 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.