Soru

Zorluk: ZorDiagnose and Log App Service Web Apps

You host a containerized ASP.NET Core web application on a Linux-based Azure App Service. You must implement a diagnostic logging solution that routes all runtime standard output (stdout) and standard error (stderr) logs to an Azure Storage account. The logs must be retained permanently for compliance auditing, and the logging mechanism must not automatically deactivate over time. Which configuration should you implement?

  1. A
    Enable Application Logging (Blob) under the App Service logs settings, select the target storage container, and define the retention policy.
  2. B
    Create a diagnostic setting for the App Service, select the AppServiceAppLogs log category, and configure the destination to archive to your Azure Storage account.
  3. Create a diagnostic setting for the App Service, select the AppServiceConsoleLogs log category, and configure the destination to archive to your Azure Storage account.Cevap
  4. D
    Enable Application Logging (Filesystem) in the App Service logs settings, set the log level to Verbose, and configure the application settings to use the Storage account connection string.

Cevap

Create a diagnostic setting for the App Service, select the AppServiceConsoleLogs log category, and configure the destination to archive to your Azure Storage account.
For Linux-based App Services, the container's standard output (stdout) and standard error (stderr) streams are the primary source of application logs. These streams are captured by the AppServiceConsoleLogs category in Azure Monitor diagnostic settings. To ensure persistent, long-term retention that doesn't expire, you must configure a diagnostic setting to forward these logs to a storage account. This bypasses the 12-hour limit associated with filesystem logging.

Adım Adım Çözüm

1
Identify the platform hosting the App Service.
The application runs on a Linux-based App Service, which routes container standard output (stdout) and standard error (stderr) as its primary log streams.
Logging behavior and available configuration options differ significantly between Windows and Linux environments in Azure App Service.
2
Select the correct diagnostic log category for Linux container console logs.
The AppServiceConsoleLogs category captures stdout and stderr from the Linux container, whereas AppServiceAppLogs is reserved for Windows trace logs.
Choosing the correct platform-specific telemetry category ensures that the target log files are captured.
3
Configure the long-term log destination to bypass filesystem deactivation.
Create an Azure Monitor diagnostic setting that routes the AppServiceConsoleLogs category to an Azure Storage account.
Standard filesystem logging automatically deactivates after 12 hours, while diagnostic settings route logs persistently to external storage for auditing.

Anahtar Kavram

Configuring persistent logging for Linux-based Azure App Services using Azure Monitor diagnostic settings and the AppServiceConsoleLogs category.
Bu soruyu puanla