12Factor App: Capturing stdout/stderr logs with Fluentd

梦想与她 提交于 2019-12-04 01:38:38

You need to configure your process manager to use fluentd.

"Twelve-factor app processes should [...] rely on the operating system’s process manager (such as Upstart, a distributed process manager on a cloud platform, or a tool like Foreman in development) to manage output streams [...]."

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).

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!