Difficulty: Beginner
Estimated Time: 10 minutes

This scenario will explore the different ways you can handle logging output from your application and services when running as containers.

This scenario explored how you can access the log files from containers and how you can change where they log too. In future scenarios we'll explore how you can use external logging services to aggregate all the logs.

Don’t stop now! The next scenario will take about 20 minutes to complete. You can pause and come back at any time.

Managing Log Files

Step 1 of 3

Step 1 - Docker Logs

When you start a container, Docker will track the Standard Out and Standard Error outputs from the process and make them available via the client.

Example

In the background, there is an instance of Redis running with the name redis-server. Using the Docker client, we can access the standard out and standard error outputs using docker logs redis-server