【问题标题】:syslog-ng sending message to console and filesyslog-ng 向控制台和文件发送消息
【发布时间】:2018-01-12 12:19:41
【问题描述】:

我想将系统日志消息发送到控制台和文件。为了将其发送到文件,我使用以下配置。

destination d_mycode { file("/var/log/app.log"); };
filter f_mycode { program(mycode); };
log { source(s_src); filter(f_mycode); destination(d_mycode); };

如何将相同的消息也发送到控制台?我需要对配置文件进行哪些更改?

【问题讨论】:

    标签: syslog-ng


    【解决方案1】:

    只需创建一个控制台目标并将其包含在您的日志路径中:

    destination d_usertty { usertty("root"); };
    log { source(s_src); filter(f_mycode); destination(d_mycode); destination (d_usertty); };
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-09
      • 1970-01-01
      • 2017-03-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-15
      • 2018-06-06
      相关资源
      最近更新 更多