Skip to content

Instantly share code, notes, and snippets.

@jwhiting
Created June 9, 2018 04:51
Show Gist options
  • Save jwhiting/f703d093a7d8b4fbb3b688139ac08ac6 to your computer and use it in GitHub Desktop.
Save jwhiting/f703d093a7d8b4fbb3b688139ac08ac6 to your computer and use it in GitHub Desktop.
truncating multi-container docker logs on elastic beanstalk
# this would go in, for instance, .ebextensions/truncate_logs.config
files:
"/etc/cron.d/truncate_logs":
mode: "000644"
owner: root
group: root
content: |
*/5 * * * * root truncate -s 0 /var/lib/docker/containers/*/*-json.log
*/5 * * * * root rm -f /var/log/containers/rotated/*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment