docker logs get latest code example
Example 1: docker tail logs
docker logs -f --tail 100 container-name
Example 2: how to clear docker-compose logs
truncate -s 0 $(docker inspect --format='{{.LogPath}}' <container_name_or_id>)
docker logs -f --tail 100 container-name
truncate -s 0 $(docker inspect --format='{{.LogPath}}' <container_name_or_id>)