Docker Community Forums

Share and learn in the Docker community.

Docker log location

I am trying to implement Docker log rotation for Ubuntu container. When I inspect the container I can see the Logpath as /var/lib/docker/containers/imageid/imageid-json.log

But when I do exec inside the container and try to go the location I can’t find the folder “ docker ” inside “ /var/lib/ ”. I even tried with /etc. But same result

To implement log rotation I have added

“LogConfig”: {
“Type”: “json-file”,
“Config”: {
“max-size”: “10m”,
“max-file”: “3”
}
}

to my deployment.template.json file (for IOT edge modules).

LogConfig{…} for the module I want to setup rotation for. But the folder </var/lib/docker/containers> itself does not exists at the said location so can’t really test the log rotation.

Can someone please help.