Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sensor log files grow without bound #50

Open
djanderson opened this issue Dec 8, 2017 · 1 comment · May be fixed by #283
Open

sensor log files grow without bound #50

djanderson opened this issue Dec 8, 2017 · 1 comment · May be fixed by #283

Comments

@djanderson
Copy link
Contributor

Docker captures all stdout and stderr output from all containers and stores them in a local log file. It does no log rotation, and the file is allowed to grow without bound. Sooner or later, that will eat up all the disk space on a sensor.

We need to look into solutions for log rotation and setting a cap on how long or much big in size docker keeps logs.

@djanderson
Copy link
Contributor Author

An easy solution for this is to install the following file:

/etc/logrotate.d/docker-container

/var/lib/docker/containers/*/*.log {
  rotate 7
  daily
  compress
  size=1M
  missingok
  delaycompress
  copytruncate
}

On my system (Ubuntu) logrotate is already run daily by cron:

$ grep -r logrotate /etc/cron*
...
/etc/cron.daily/logrotate:/usr/sbin/logrotate /etc/logrotate.conf

@bradeales, I might need some helping adding this to puppet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant