how to clear docker container logs code example
Example 1: how to clear docker-compose logs
truncate -s 0 $(docker inspect --format='{{.LogPath}}' <container_name_or_id>)
Example 2: how to clear docker-compose logs
echo "" > $(docker inspect --format='{{.LogPath}}' <container_name_or_id>)