How to Access Docker Container Logs in Azure App Services?

0
26
Asked By ChillPineapple42 On

I've deployed a Docker container to Azure App Services, and it works fine locally with Docker Desktop, where all my app files—including HTML and logs—are stored in the /user/local/tomcat directory. However, I can't seem to find a similar directory structure in Azure. I'm particularly trying to access a specific log file, but when I use Kudu to SSH, I can't find where that directory is located. Does anyone know how to access these logs or where this directory might be?

4 Answers

Answered By CloudExplorer9 On

If you're open to it, I suggest switching to Azure Container Apps. They’re generally easier to work with compared to App Services and can be more cost-effective. In Container Apps, logs are captured automatically and can be viewed in real-time. Plus, if you need persistent storage, you can set up volumes to mount in the container. Just be aware that without a mounted volume, the container storage is ephemeral.

Answered By DockerDude77 On

Check how your Docker container is set up. Does your Docker run command mount a directory from your local machine to the /user/local path, or does your Dockerfile copy files into the image? You might find what you're looking for by running it locally.

Answered By TechSavvy123 On

To access the logs, make sure you're SSH'ing into the container itself, not just the app service. That way, you'll be able to navigate to the correct directories where your logs are stored.

Answered By CodeNinja88 On

Are you certain you have a log file in the container? It's possible that what you see as logs in Docker is actually just the Docker log stream. You can grab the latest logs in a zip file directly from Kudu.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.