When something breaks I used to run docker compose logs and stare at a wall of text from last Tuesday. Now I ask for only the last few minutes, and the error is usually right there.
Docker’s own docs list a --since flag for docker compose logs. It takes a timestamp or a relative time, so 10m means the last ten minutes. Add -f to keep following and -n (or --tail) to cap the lines per container:
docker compose logs --since 10m -f -n 50 sonarr
Leave the service name off and you get every service in the stack. Add -t if you want a timestamp on each line, which helps when you try to match an error to the moment you clicked something.
One caveat: it only reads what the container’s log driver still keeps. If you rotate logs aggressively, older lines are gone, so --since 2d will not bring them back. It is also read-only, so nothing here can hurt your stack. Check your Compose version with docker compose version if the flag is not recognised.
Further reading: docker compose logs (Docker docs), On this site: docker logs –since 10m -f shows only what just happened, On this site: docker compose run –rm gives you a one-off command that cleans up after itself