Delen via


Umbraco logging in Azure App Service

Umbraco is a third-party CMS that can be hosted in Azure App Service. Umbraco has built-in Log4Net logging that can be useful for troubleshooting issues within an Umbraco application.

In Azure App Service, these logs can typically be found under D:\home\site\wwwroot\App_Data\Logs. The naming convention for these logs is UmbracoTraceLog.InstanceName.txt .

Note:  InstanceName refers to a machine instance that hosts your App Service, so if your App Service Plan has multiple instances or if the apps are moved to a new instance over time, you may see multiple log files in this folder.

You can view this logging configuration under D:\home\site\wwwroot\Config\log4net.config , and can change the logging level (eg DEBUG, INFO, WARN, ERROR, or FATAL). The default logging level is WARN.

You can access these files using the App Service's Kudu console at https://<sitename>.scm.azurewebsites.net/DebugConsole or by using an FTP client.

 

For example, I was troubleshooting an issue where the application pool was recycling when files were published to Umbraco.

In the Umbraco logs, I found the following event, which indicated the reason for this behavior:

yyyy-mm-dd hh:mm:ss [P<processId>/D<appDomainId>/T<thread>] INFO  Umbraco.Core.UmbracoApplicationBase - Application shutdown. Details: HostingEnvironment

_shutDownMessage=Change Notification for critical directories.

Overwhelming Change Notification in App_LocalResources

HostingEnvironment initiated shutdown

CONFIG change

 

I learned that this behavior was related to the fcnMode setting that the application was using. Umbraco uses fcnMode=Single by default, which is beneficial in many scenarios in that it automatically restarts the app domain when certain app changes are made, so that you don't need to do a site restart. However, in certain cases, the buffer can become overwhelmed since Single mode uses a single buffer for all subdirectories, and can cause the application pool to recycle (site restart). A workaround is to use fcnMode=Disabled, which means that you would need to restart the site in order for the app changes to show up. The potential benefit to this approach is that you have more control over when the application pool recycles.

More information about the fcnMode behavior in Umbraco can be found here.

The fcnMode setting, if present in the web.config, would be found under System.Web, in the httpRuntime element. For example:

<httpRuntime fcnMode="Single" />