How to use syslog with LOG4J 1.x?

1.8k Views Asked by At

I want to config my LOG4J. I can't update the version to 2.x because it's a big application. The actual Documentation for the LOG4J version 1.x is offline.

Here is my actual config for the appender:

<appender name="syslog" class="org.apache.log4j.net.SyslogAppender">
      <param name="SyslogHost" value="localhost:514"/>
      <param name="Facility" value="LOCAL1"/>
      <param name="FacilityPrinting" value="true"/>
      <param name="Threshold" value="WARN"/>
      <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" value="%d{dd.MMM.yyyy HH:mm:ss} %-5p %m%n"/>
      </layout>
  </appender>

I tested it with : netstat -a -b > test.txt

But i dont't found something with the Port 514.

Can somebody help me(because he made experience with LOG4J 1.x), or has somebody a copy of the documentation from LOG4J 1.x ?

1

There are 1 best solutions below

0
J. H On
<appender name="Syslog" class="org.apache.log4j.net.SyslogAppender">
    <param name="SyslogHost" value="IP:514"/>
    <param name="Facility" value="USER"/>
    <param name="FacilityPrinting" value="true"/>
  <param name="Threshold" value="INFO"/>
  <layout class="org.apache.log4j.IvyLog4jLayout">
      <param name="DateFormat" value="MM/dd/yyyy hh:mm:ss"/>
    </layout>
</appender>

This way it worked for me :)