Hey, just wanted to share what I did to prevent the need for the host bind mount.
The idea is that I use a different location for the /dev/log socket, so that I can do --volumes-from without conflict. On another container, I just symlink /dev/log to that location. I also send the logs that I want to stderr so that I can do docker logs to get them.
RUN apt-get update && \
apt-get install rsyslog --no-install-recommends -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY rsyslog.conf /etc/
CMD ["rsyslogd", "-n"]
# load imuxsock module with alternative socket location
input(type="imuxsock" Socket="/var/run/rsyslog/dev/log" CreatePath="on")
# Send your logs to stderr so that `docker logs` works
Now, for example, in a PHP container you do --volumes-from syslog and run ln -sf /var/run/rsyslog/dev/log /dev/log (I do it in an entrypoint, but you get the idea of what needs to happen).
ln -sf /var/run/rsyslog/dev/log /dev/log
Now when my PHP container sends something to LOCAL1 using syslog, I get those with docker-compose logs syslog.
docker-compose logs syslog
Oh, nice! If you wrote about this somewhere (blog post or whatever), I'd be happy to link to it from this project's documentation ... Or, maybe I could add this (and your name) in a markdown file linked from the toplevel README file?
Hey, the only documentation I have is in https://registry.hub.docker.com/u/helder/rsyslog/ and an example of a container using it with an entrypoint at the end of https://registry.hub.docker.com/u/helder/php/