How to set retention time for contianer logs?

Hi,

i am quite new to docker.
I noticed that logs are stored in /var/lib/docker/containers/<container_id>/<container_id>-json.log

How can I set retention time for container logs? e.g. I only need the last 500MB or the last 7 days.
I don’t want to have my disk filled up with logs

Thanks a lot, Andreas