Up until now, when looking at logs in Docker, I did it like this:
In this case, since all past logs are displayed first, and then it becomes a tail -f state, it takes a long time to display the latest logs when there are a large number of logs, which can be quite inconvenient.
docker logs -f [container]
With this method, the latest 10 logs are displayed immediately.
This is convenient! 😊
docker logs --tail 10 -f [container]
docker-compose --tail 10 -f