Feature: Ability to clear log history
A feature I've thought would be useful since originally using Fig, and now Compose would be the ability to clear the log history for Composed-managed containers. Long-running or "chatty" containers can end up with a lot of log noise that may not be wanted.
I'd expect a command like the following would solve the problem:
$ docker-compose logs --clear [service]
I don't think that is a feature supported by the docker daemon. Looking at the api docs, the only option would be to truncate the returned logs to a limited number of lines per container:
https://docs.docker.com/reference/api/docker_remote_api_v1.17/#get-container-logs
:+1: for this issue. I actually use compose to develop a website in Golang, Mongodb and nginx... 5 days after begining I have a long logs that becomes to be worrying. Each time I restart containers append many lines to the log. @dnephin I don't understand if you give a solution (that I don't understand :)) or if you propose to check if it's possible with api. Sorry for my bad english.
Docker 1.6 will add support for logging drivers, see https://github.com/docker/docker/pull/10568 (currently; JSON, syslog and "none") work is in progress for basic log-rotation; https://github.com/docker/docker/pull/11485
Good to hear that, thanks a lot :)
Thanks for the background and update on Docker 1.6 - looking forward to it!
docker logs -c (clear) <container> would be great.
+1
+1 Really important
Holy cow, I just sat through several minutes of logs to get to the end. I'd really appreciate this as well for the sake of not having to rebuild containers constantly.
+1
+1
+1
:+1:
+1
+2
+1
Just for the record, with Docker 1.8 and docker-compose 1.4 there is already exists a method to limit log size using https://docs.docker.com/compose/yml/#log-driver and log-opt max-size:
log_driver: "json-file"
log_opt:
max-size: "100k"
max-file: "20"
@dmage Thanks, exactly what I need.
+1000
+1 would LOVE this
+1