Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[docker] logging driver: journald vs syslog

10 views
Skip to first unread message

Peter Wall

unread,
Jan 11, 2023, 6:05:06 AM1/11/23
to
$ cat test2
#!/bin/bash
for suffix in journald syslog; do
cat daemon-$suffix.json
sudo ln -sf $PWD/daemon-$suffix.json /etc/docker/daemon.json
sudo systemctl restart docker

echo docker run...
docker run --rm bash echo "$(date) stdDOCKERout"
docker run --rm bash -c 'echo "$(date) stdDOCKERerr" > /dev/stderr'

echo journalctl grep...
(journalctl --output cat -b | grep stdDOCKER || echo RECORD NOT
FOUND) | tail -n2
done

$ test2
{
"log-driver": "journald",
"log-opts": {
"tag": "{{.ImageName}}/{{.Name}}/{{.ID}}"
}
}
docker run...
mar 10 gen 2023, 12:59:47, CET stdDOCKERout
Tue Jan 10 11:59:48 UTC 2023 stdDOCKERerr
journalctl grep...
mar 10 gen 2023, 12:59:47, CET stdDOCKERout
Tue Jan 10 11:59:48 UTC 2023 stdDOCKERerr
{
"log-driver": "syslog",
"log-opts": {
"tag": "{{.ImageName}}/{{.Name}}/{{.ID}}"
}
}
docker run...
mar 10 gen 2023, 12:59:53, CET stdDOCKERout
Tue Jan 10 11:59:54 UTC 2023 stdDOCKERerr
journalctl grep...
mar 10 gen 2023, 12:59:53, CET stdDOCKERout
Tue Jan 10 11:59:54 UTC 2023 stdDOCKERerr

OK!!!
It even seems to work with both logging drivers (journald and syslog).
So where is the difference?
0 new messages