Unable to Enable Application Logs for Linux Web App on Azure App Service

Jacob Hughes-Hallett 0 Reputation points
2024-10-10T14:18:43.8766667+00:00

Details:

I am trying to enable application logging for my Django app running on a Linux-based Azure App Service. My app is set up with the following details:

  • Operating System: Linux
  • Runtime Stack: Python 3.12
  • App Service Plan: PremiumV2 (P1v2)
  • Deployment Provider: VSTSRM (Azure DevOps)

Despite updating the App Service settings to enable Application Logging (File System) and restarting the app, I am unable to see any real-time logs in the Log Stream. The log stream is connected, but no new logs are coming through, and I keep seeing messages like:

Logging is not enabled for this container. Please use https://aka.ms/linux-diagnostics to enable logging to see container logs here.

Steps I've Taken:

  1. Enabled Application Logging (File System) from the App Service settings.
  2. Modified the Django settings to configure logging in the settings.py file.
  3. Restarted the app and tested various requests that should generate logs.
  4. Verified that my role has sufficient permissions, but I'm still not seeing the full diagnostic logging options (e.g., log levels, detailed error messages).
  5. The app is running fine in the normal browser, but in incognito mode, I get a 500 error on one specific page, and I need logs to troubleshoot.

Questions:

  1. Why am I not able to see logs in the Log Stream even though I have enabled logging from the App Service settings?
  2. Are there additional steps to configure logging for a Linux-based Azure Web App running Django?
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,930 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,173 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.