Meng Lu
Meng Lu

Reputation: 14626

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?

Upvotes: 3

Views: 1117

Answers (1)

Remko Popma
Remko Popma

Reputation: 36754

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.)

Upvotes: 3

Related Questions