Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is equivalent to log4j 1 `log4j.appender.SYSLOG.Header=true` in log4j 2?

I'm migrating a log4j.properties to log4j2.xml. Syslog appender in the former has a configuration

log4j.appender.SYSLOG.Header=true

What's the equivalent setting in log4j2.xml?

like image 237
Meng Lu Avatar asked Dec 10 '25 10:12

Meng Lu


1 Answers

There is no need to do anything:

In log4j 1, setting log4j.appender.SYSLOG.Header=true resulted in the appender including the HEADER part (that is, timestamp and host name) of the syslog packet.

In log4j 2, the timestamp and host name are always included. (Looks like this cannot be switched off.)

like image 166
Remko Popma Avatar answered Dec 13 '25 00:12

Remko Popma



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!