Docker Community Forums

Share and learn in the Docker community.

Docker logging driver "json-file", not able to locate json log file where the logs are written

Docker logging driver “json-file”, not able to locate json log file where the logs are written

with

$ docker inspect -f {{.LogPath}} $HERE_IS_YOUR_CONTAINER

you can get the path to your json logfile.
For my setup it is under:
/var/lib/docker/containers/8e9606e2e503d25ab6273efd4381b034f9c9fdeb4e601152689b13e988388726/8e9606e2e503d25ab6273efd4381b034f9c9fdeb4e601152689b13e988388726-json.log

But do not understand why you want to access the file directly. Prefer to use the docker logs command.

1 Like

In my MAC, i am not able to see this file for some reason. I can do docker logs.

We have Openshift v3.1 (os - RHEL) which is running in our company, it uses json-file and these files are read by td-agent(fluentd) , which formats it. This formatted file is then forwarded to Splunk.

So, we could see <container_hash>-json.log files are read by td-agent. Hence, wanted to reproduce the same.

We have a requirement, wherein we want to “secure_forward” from td-agent to our custom tcp+tls logging service.