I wish to keeps the logs of my container to a file in my host machine for every container. I read about doing the same via logging driver.
Since my host machine runs ubuntu 14.04, which has rsyslog
running by default, I thought to use syslog
.
What I did was used following command to run the container:
docker run -it --log-driver=syslog --log-opt syslog-address=udp://localhost:514 prashant23/ubuntu-java:sample-jdbc-project bash
and I went inside the container without any error. That's all? How do I know that where I can see logs on my host machine? Did I do everything right? I have no idea about syslog
. Do I need to configure syslog on my container too? Is there any better approach to achieving the same.
I am not sure what should I use as syslog-address
. From where I can get the value of this parameter? I somewhere read default is udp://localhost:514