logrotate
was setup on Ubuntu 20.04 to limit the besu log file size to 10MB, keep 4 weeks log with rotating weekly and delete the old log file. Here is the besu conf:
#for besu log
/home/log/besu/* {
size 10M
missingok
rotate 4
weekly
postrotate
/usr/bin/find /home/log/besu/ -name "node*.log.*" -type f -mtime +0 -exec rm {}
\;
endscript
}
The log file is named as node[1-4].log
. Here is the ls
output:
As the output shows, there are 18 files started with node1
and the file size is 1.6GB. It seems that none of the above conf goal has been achieved. What is missing in the log conf file?