简体   繁体   中英

Logs of a docker container

Where does docker store it logs in the host machine as well as in the docker container. I know you can use docker logs . I want to know what is the physical location. Here is any example to illustrate more. I have got a java application which is generating standard output logs. I am using the following script to run it on a docker container

#!/bin/bash
nohup java -jar /opt/pubsub/publish.jar &
java -jar /opt/pubsub/subscribe.jar

I am unable to find my nohup in the container however I can see the content of nohup using docker logs . So where is my nohup??

Secondly where are the logs which are generated by docker itself?

They are stored in /var/lib/docker/containers

You can try docker-ci, it offers a solution to logging. It will watch the logs and send it to the client.

I hope this will help you.

http://docker-ci.org/documentation#remote-logging

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM