Question

Difficulty: EasyDiagnose and Log App Service Web Apps

A developer is troubleshooting an Azure App Service web app and notices that no application logs are appearing in the Log Stream tool of the Azure Portal, even though the application code contains standard logging statements. The developer has not configured any external storage or monitoring services. What is the most likely cause of this issue?

  1. Application logging to the file system is disabled in the Azure App Service configuration.Answer
  2. B
    The Application Insights SDK is initialized in the code but the connection string is missing.
  3. C
    The web app is hosted on a Consumption plan which does not support diagnostic log streaming.
  4. D
    The log messages exceed the 64 KB size limit per log entry.

Answer

Application logging to the file system is disabled in the Azure App Service configuration.
Application logging to the file system is disabled by default in Azure App Service. To view real-time logs in the Log Stream tool, developers must explicitly enable application logging to the file system in the settings.

Step-by-Step Solution

1
Identify the primary mechanism for built-in log streaming in Azure App Service.
The Log Stream tool in the Azure Portal displays stdout/stderr and application logs written directly to the App Service file system.
Understanding where the Log Stream tool reads its source data is necessary to troubleshoot missing logs.
2
Check the default status of filesystem application logging in Azure App Service.
Application logging to the file system is disabled by default for Azure App Service web apps.
Since the developer has not enabled filesystem logging, the application's log statements are not captured by the App Service container host.
3
Determine the required resolution.
Enable 'Application Logging (Filesystem)' under the 'App Service logs' menu in the Azure Portal or via Azure CLI.
Enabling this setting instructs the App Service to capture stdout/stderr or application logs and stream them to the console.

Key Concept

Enabling application logging to the filesystem is a prerequisite for using the built-in App Service Log Stream.
Rate this question