【问题标题】:what is $InputFilePollInterval in rsyslog.conf? by increasing this value will it impact on level of logging?rsyslog.conf 中的 $InputFilePollInterval 是什么?通过增加此值会影响日志记录级别吗?
【发布时间】:2019-06-19 22:29:48
【问题描述】:

在 rsyslog 配置文件中,我们配置为所有应用程序日志都将写入 /var/log/messages 但日志以非常高的速率写入,如何降低应用程序级别的日志记录级别

【问题讨论】:

    标签: linux rsyslog


    【解决方案1】:

    希望这是您正在寻找的。 在文本编辑器中打开文件:

    /etc/rsyslog.conf
    

    将以下参数更改为您认为对您有益的参数:

    $SystemLogRateLimitInterval 3
    $SystemLogRateLimitBurst 40
    

    重启 rsyslogd

    service rsyslog restart 
    

    $InputFilePollInterval 等价于:“PollingInterval”

    PollingInterval seconds
    Default: 10
    
    This setting specifies how often files are to be polled for new data.
    The time specified is in seconds. During each polling interval, all 
    files are processed in a round-robin fashion.
    
    A short poll interval provides more rapid message forwarding, but 
    requires more system resources. While it is possible, we stongly 
    recommend not to set the polling interval to 0 seconds
    

    .

    【讨论】:

    • 您好 skr,感谢您的回复。如果这些参数没有在我的 rsyslog.conf 中定义,究竟会发生什么......?系统会采用任何默认值吗?
    【解决方案2】:

    有几种方法可以解决这个问题,这取决于您究竟想要做什么,但您可能希望查看separating your facilities into separate output files, based on severity。这可以在您的配置文件中使用RFC5424 severity priority levels 来完成。

    通过按设施和/或严重性将日志拆分为单独的文件,并设置 stop 选项,可以根据需要将基于严重性的消息输出到任意数量的文件。

    示例(在rsyslog.conf 文件中设置)

    *.*;auth,authpriv,kern.none   /var/log/syslog
    kern.*                        /var/log/kern.log
    kern.debug                    stop
    *.=debug;\
      auth,authpriv.none;\
      news.none;mail.none         /var/log/debug
    

    此配置:

    • 不会将任何kern 设施消息输出到syslog(由于kern.none
    • kern 的所有调试级别日志输出到kern.log 并在此处“停止”
    • .none未排除的任何其他调试日志输出到debug

    如何分开取决于您,但我建议您查看我包含的第一个链接。您可能还想查看different local facilities that can be used as separate log pipelines

    【讨论】:

      猜你喜欢
      • 2019-06-05
      • 1970-01-01
      • 1970-01-01
      • 2023-02-22
      • 2015-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-06
      相关资源
      最近更新 更多