Skip to content

Instantly share code, notes, and snippets.

@phainamikaze
Created July 15, 2024 09:12
Show Gist options
  • Save phainamikaze/e3400f743a72b4e516568576265459c8 to your computer and use it in GitHub Desktop.
Save phainamikaze/e3400f743a72b4e516568576265459c8 to your computer and use it in GitHub Desktop.
docker log limit

docker log limit

method 1 -> docker run example

docker run -d \
  --log-driver json-file \
  --log-opt max-size=5k \
  --log-opt max-file=10 \
  chentex/random-logger:latest

method 2 -> docker compose example

services:
  service_name:        
    logging:
      driver: "json-file"
      options:
        max-size: "5k"
        max-file: "10"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment