Skip to main content

Docker in Production

Logging and Monitoring

0:00
LearnStep 1/4

Docker Logging

Container Logging

Logging Best Practices

Containers should write logs to STDOUT and STDERR:

javascript

Why STDOUT/STDERR?

  • Docker captures logs automatically
  • Works with logging drivers
  • No disk space issues in container
  • Follows 12-factor app principles
  • Easy to integrate with log aggregation

Viewing Logs

bash

Logging Drivers

text

Configuring Log Driver

bash