I installed my Docker container container to send logs to host logs on CentOS 7 (c --log-driver syslog). I would like to reproduce this on macOS (Sierra). But he does not appear anywhere, it seems.
$ docker run --log-driver syslog -it busybox sh
/ # logger "Hello world!"
/ # exit
and
$ sudo cat /var/log/system.log | grep "Hello world"
Password:
$
What configuration is needed so that any Docker log command for any arbitrary container appears in the log file on macOS?
I can view these types of syslogs by default if I do not configure log-driver. But the Ruby syslog implementation must be logged in different ways.
$ docker run --log-driver syslog -it centos /bin/bash
# yum install ruby -y
# ruby -e "require 'syslog/logger'; log = Syslog::Logger.new 'my_program'; log.info 'this line will be logged via syslog(3)'"
# exit
$ sudo tail -n 10000 /var/log/system.log | grep "syslog(3)"
$
source
share