Knowledgebase

How to View and Rotate Docker Container Logs Print

  • 0

Stop runaway JSON logs from filling up your VPS NVMe disk.

Step-by-Step Instructions

  1. Inspect live logs with docker logs -f --tail 100 container_name.
  2. Configure max-size and max-file in /etc/docker/daemon.json.
{
  "log-driver": "json-file",
  "log-opts": { "max-size": "10m", "max-file": "3" }
}

Pro Tip: Restart Docker (systemctl restart docker) after editing daemon.json.

Need assistance? Open a ticket in the A1 Client Area or contact our 24/7 NOC Engineering Team on WhatsApp at +1 (406) 229-9597.


Was this answer helpful?

« Back