Hello!

I have a Docker version 1.12.1, build 23cf638 and a question about it: Is it possible to force the container to pour logs into the hypervisor without installing an add. utilities and other containers? Well, that is, I have a debian , there is a docker-engine on it in which there is a certain container , so I want this container to give its logs to rsyslog which is installed on debian, without any crutches, utilities and their ilk? That is, when I read the /var/log/daemon.log log in debian, I want to see something like:

 Sep 10 19:49:25 debian container1[701]: Hello Sat Sep 10 14:49:25 UTC 2016 Sep 10 19:49:26 debian container2[702]: Hello Sat Sep 10 14:49:26 UTC 2016 Sep 10 19:49:27 debian container3[703]: Hello Sat Sep 10 14:49:27 UTC 2016 Sep 10 19:49:28 debian container4[704]: Hello Sat Sep 10 14:49:28 UTC 2016 Sep 10 19:49:29 debian containerN[705]: Hello Sat Sep 10 14:49:29 UTC 2016 Sep 10 19:49:30 debian containerN+6321465234123[666]: Hello Sat Sep 10 14:49:30 UTC 2016 
  • Everything, found, litter for anxiety, just tried it before sending it to a remote server, so I protupil it. Answer: Start the container like this docker run -t -d --log-driver=syslog --log-opt tag="{{.Name}}" ubuntu /bin/bash -c 'while true; do echo "Hello $(date)"; sleep 1; done' docker run -t -d --log-driver=syslog --log-opt tag="{{.Name}}" ubuntu /bin/bash -c 'while true; do echo "Hello $(date)"; sleep 1; done' docker run -t -d --log-driver=syslog --log-opt tag="{{.Name}}" ubuntu /bin/bash -c 'while true; do echo "Hello $(date)"; sleep 1; done' RTFM: docs.docker.com/engine/admin/logging/overview - user219718
  • Hmm, strange, but such focus doesn’t work with alpine ...: (More precisely, echo works, but the daemon running in the container continues to write a log to it :( - user219718

0