The log files of my nodes are getting larger and larger within Docker. How have you organized for space management? Do you “prune” logs sometimes?
You could try this…
3 Likes
Hello,
I personnaly configure the docker log driver : Configure logging drivers | Docker Documentation
I just create this file : /etc/docker/daemon.json
with the following content :
{
"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3"
}
}
it’s fine for me as I have docker only for for Storagenode and anyway 10m is enough for most cases.
1 Like
I keep them all. Rotated on each node restart, so around every two weeks, then compressed with xz. This way they don’t take much space.
1 Like
I am using log rotate with the following configuration:
sudo vi /etc/logrotate.d/storagenodes
/mnt/WD1003/logs/*.log
{
weekly
missingok
rotate 4
copytruncate
compress
notifempty
}
sudo logrotate -vf /etc/logrotate.d/
Plus the docker run command with the following parameters:
…
--log-opt max-size=1g \
--log-opt max-file=5 \
…
--mount type=bind,source="/mnt/WD1003/logs",destination=/app/logs \
…
1 Like