【问题标题】:What is equivalent to log4j 1 `log4j.appender.SYSLOG.Header=true` in log4j 2?什么相当于 log4j 2 中的 log4j 1 `log4j.appender.SYSLOG.Header=true`?
【发布时间】:2015-08-04 07:29:58
【问题描述】:

我正在将 log4j.properties 迁移到 log4j2.xml。前者中的 Syslog appender 有一个配置

log4j.appender.SYSLOG.Header=true

log4j2.xml 中的等效设置是什么?

【问题讨论】:

    标签: java logging log4j log4j2 syslog


    【解决方案1】:

    什么都不用做:

    在 log4j 1 中,设置 log4j.appender.SYSLOG.Header=true 导致 appender including the HEADER part (that is, timestamp and host name) of the syslog packet

    在 log4j 2 中,timestamp and host name are always included。 (好像不能关闭。)

    【讨论】:

      猜你喜欢
      • 2014-11-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-06
      • 2014-07-04
      相关资源
      最近更新 更多