A log rotation script is packaged within the Coreapp and Webapp containers.
The log rotation script in the Webapp container:
The log rotation script in the Coreapp container:
In the Coreapp, a new log file is only created when the size exceeds 15MB per log file. The old log files are not removed automatically.
WhatsApp recommends you periodically (i.e., daily) execute the cleanup script below to perform log rotation on all Webapp, Coreapp and Master (in the case of a Multiconnect setup) containers. It's best to configure a cronjob on your host to perform on all running WhatsApp Business API containers and be executed during off-peak hours. Invoking the cleanup script periodically will keep the disk space consumed by log files under control.
docker exec your-container-name /opt/whatsapp/bin/cleanup.sh