I was wondering if there is currently a configuration option to have debug/info logs go to stdout and warn/error go to stderr. This would fit well with Docker’s syslog backend.
Is this currently possible with configuration of the console backend, or would I need a custom Logger backend?
:device - the device to log error messages to. Defaults to :user but can be changed to something else such as :standard_error.
Thank you for pointing the device option. I couldn’t however find a way to configure multiple instances of the console backend, to apply different device and level config options.
I ended up using a different approach to get the logs out of the docker container: mapping the host /dev/log and using a syslog backend to write directly to it.
The container is started with
-v /dev/log:/dev/log in docker run. The host is running syslog-ng as the log collector.
The application uses a custom Logger backend (https://github.com/pma/logger_syslog_backend) to write directly to the /dev/log Unix Socket.