I want to log journald logs to a file so I can later on fetch it and send it to Logstash. I thought about running syslog-ng and make it a client of journald, so I'd get syslog files. I'm using Docker containers on a CoreOS machine, so I tried to run syslog-ng as a container in the CoreOS docker host, creating a systemd unit that executes the container. I followed this page to get syslog in systemd, but if I try to make my syslog-ng container directly read from the syslog socket in the host (by mounting it with a docker volume), it complains about "Address already in use". So I have journald logging, a container with syslog-ng running, but I don't know how to get journald logs inside syslog-ng.
My alternative solution to get journald logs in a file is to run a systemd unit that executes journalctl -f --json | tee -a /var/log/systemd
, but I'm not sure about the reliability of this solution. Is this a good enough solution?