By reading the following post from 12factor I have come up with a question I'd like to check how you guys handle this.
Basically, an app should write directly to stdout/stderr. Is there anyway to redirect these streams directly to fluentd (not bound to rsyslog/syslog)? As I become more aware of fluentd, I believe it would be a great tool for log aggregation from multiple apps/platforms.
The main reasoning for this is, if the app is cross-platform, rsyslog/syslog may not be available, and as I understand, using logging frameworks (which need the required configuration for them to work) would be a violation of the 12factor.
Thanks!
This is still an experimental program, but you can take a look at stdout-hook.
This program reads STDOUT output from child process, and post the records to Fluentd.
You need to configure your process manager to use fluentd.
Basically, the idea is that log redirection is a concern of the process manager. Upstart, for example, usually relies on logger, which has an option (
-u
) to write to a Unix Domain Socket. In turn, you can configure fluentd to use that same socket as an input stream.Fluentd supports a lot of input streams (they call them data sources), which should provide a solution for just about any environment & process manager you might be using (which we need to know in order to provide a more complete solution).