Closed linus-komnick closed 2 years ago
I was missing a couple of steps to make it work. Here is how I solved it:
Uncomment the following in /etc/rsyslog.conf:
# provides TCP syslog reception
module(load="imtcp")
input(type="imtcp" port="514")
Restart syslog:
systemctl restart rsyslog.service
Create daemon.json in /etc/docker (if it doesn't already exist) and make sure it contains the following:
{
"log-driver": "syslog",
"log-opts": {
"syslog-address": "tcp://127.0.0.1:514"
}
}
Restart docker:
systemctl restart docker
Now all logs will end up in /var/log/syslog
Everything works fine when I run
$ node server.js
. But as soon as I run it with docker, my syslog daemon stops receiving any logs.This is how I implement it:
logger.add(new logger.transports.Syslog());
My guess is that I have to add/dev/log
as a volume when running docker, but it doesn't seem to work.Does anybody know how to fix this?