gpt4 book ai didi

logging - 12因素应用程序: Capturing stdout/stderr logs with Fluentd

转载 作者:行者123 更新时间:2023-12-04 02:21:01 25 4
gpt4 key购买 nike

通过阅读来自 12factor 的以下帖子我想出了一个问题,我想看看你们如何处理这个问题。

基本上,应用程序应该直接写入 stdout/stderr。无论如何重定向这些流直接到流利的 (不绑定(bind)到 rsyslog/syslog)?随着我越来越了解 fluentd,我相信它将成为来自多个应用程序/平台的日志聚合的绝佳工具。

这样做的主要原因是,如果应用程序是跨平台的,rsyslog/syslog 可能不可用,据我了解,使用日志框架(需要所需的配置才能工作)将违反 12factor。

谢谢!

最佳答案

您需要配置您的流程管理器以使用 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 [...]."



基本上,这个想法是日志重定向是流程管理器的一个问题。 Upstart ,例如,通常依赖于 logger ,它有一个选项( -u )写入 Unix Domain Socket .反过来,您可以 configure fluentd to use that same socket as an input stream .

Fluentd supports a lot of input streams (他们称它们为数据源),它应该为您可能正在使用的任何环境和流程管理器提供解决方案(我们需要知道这些以提供更完整的解决方案)。

关于logging - 12因素应用程序: Capturing stdout/stderr logs with Fluentd,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28730462/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com