Reputation: 343
I have a aws instance where I am running a docker container (let it be for any process). The log file in var/log/docker.log is exceeding the storage of the vm. How can I clear the logs and make the storage available in a very clean way.
Upvotes: 0
Views: 8238
Reputation: 389
Use the truncate command to empty the logs
truncate -s 0 /var/log/docker.log
There is mention of an old issue with AWS linux instances not rotating docker logs, and a workaround is to use logrotate and update the user data script. https://github.com/aws/amazon-ecs-init/issues/119
Upvotes: 4
Reputation: 11772
You should empty the log file.
cat /dev/null > /var/log/docker.log
Upvotes: 0