Soru

Zorluk: OrtaDiagnose and Log App Service Web Apps

An enterprise web application is hosted on a Linux-based Azure App Service. A developer needs to configure built-in application logging to capture standard output (stdout) and standard error (stderr) streams to the local filesystem for temporary debugging, and also stream these logs to an Azure Storage account for long-term retention.

Which of the following configurations must the developer perform? (Select two.)

  1. Run the Azure CLI command: az webapp log config --name myApp --resource-group myRG --docker-container-logging filesystemCevap
  2. Configure a Diagnostic Setting on the App Service to send the AppServiceConsoleLogs category to the Azure Storage account.Cevap
  3. C
    Run the Azure CLI command: az webapp log config --name myApp --resource-group myRG --application-logging filesystem
  4. D
    Configure a Diagnostic Setting on the App Service to send the AppServiceAppLogs category to the Azure Storage account.

Cevap

The developer must run the Azure CLI command to configure docker container logging to the filesystem and configure a Diagnostic Setting on the App Service to send the AppServiceConsoleLogs category to the Azure Storage account.
For Linux-based Azure App Services, application logs correspond to stdout and stderr streams. These are enabled on the local filesystem using the docker-container-logging filesystem parameter in the Azure CLI. To archive these logs to a storage account, a Diagnostic Setting must be configured to forward the AppServiceConsoleLogs category.

Adım Adım Çözüm

1
Enable container-level diagnostic logging on the Linux-based App Service.
Execute the command 'az webapp log config --name myApp --resource-group myRG --docker-container-logging filesystem'.
Linux App Services run applications inside containers where stdout and stderr represent application logs. These are configured using the docker-container-logging parameter.
2
Determine the diagnostic log category for container logs.
Identify 'AppServiceConsoleLogs' as the designated category.
On Linux, console logs are collected under the AppServiceConsoleLogs category, distinct from the Windows-specific AppServiceAppLogs category.
3
Configure the streaming endpoint for long-term retention.
Create a Diagnostic Setting sending 'AppServiceConsoleLogs' to the target Storage account.
Diagnostic settings route the selected log streams to Azure Storage, Event Hubs, or Log Analytics.

Anahtar Kavram

Configuring container console logging and diagnostic settings on Linux-based Azure App Service
Bu soruyu puanla