Docker logs control


Could You, please tell me how to control logs of docker?

As I can see it is stored ( by default ) /var/lib/…/…json.log

And size is growing - growing… I guess to enable lograte to this path is not good solution cause docker have native one, so yesterday I put tags in docker-compose.yml:

max-size: “10m”
max-file: “3”

As I expected after file size = 10m it will rotate and history for 3 files.

And restarted container, but as I can see today log file size 100m already, so it is not working. Is it possible to control logs on this level? Or is it possible only through whole docker config ( /etc/docker/daemon.json ) ?

Thank You,


Thank You for Your help,

Everything working as expected ( configuartion in docker configuration, not docker-compose ), no logrotate is needed.