Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where is the Docker JSON file logging driver writing files to?

Tags:

docker

logging

I have Dockerized a sample app and have configured it to log to STDOUT. I then run the container without specifying a logging-driver. According to the Docker docs, STDOUT should be collected out of the container and into a JSON file...

But nowhere in the logging docs do they tell you where you can find this JSON file!!!

Any ideas how I could find this file on my host and inspect its contents?

like image 294
smeeb Avatar asked Jun 16 '17 01:06

smeeb


1 Answers

docker inspect is your friend to figure out details regarding a container. With this you can get the log path by running following command:

$ docker inspect --format='{{.LogPath}}' NAME|ID

For example:

$ docker inspect --format='{{.LogPath}}' 2de7566c47eb

Hope it helps.

like image 82
Qasim Sarfraz Avatar answered Nov 16 '22 03:11

Qasim Sarfraz