我正在将 log4j.properties 迁移到 log4j2.xml。前者的 Syslog appender 有一个配置
log4j.appender.SYSLOG.Header=true
log4j2.xml 中的等效设置是什么?
最佳答案
不需要做任何事情:
在 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 . (看起来无法关闭。)
关于java - 什么相当于 log4j 2 中的 log4j 1 `log4j.appender.SYSLOG.Header=true`?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31803184/