Log4j
Log4j is used to retrieve logs from Java applications. Logs from Log4j can be sent to the Logmanager server via Syslog protocol.
-
You need to find the configuration file for Log4j in the Java application. Most often is saved as
logging.properties
file orlog4j.properties
file. -
Edit configuration file:
rootLogger = DEBUG, udp appender.udp = org.apache.log4j.receivers.net.UDPAppender appender.udp.RemoteHost = <Logmanager_IP_address> appender.udp.port = 514 appender.udp.layout.type = org.apache.log4j.PatternLayout appender.udp.layout.ConversionPattern = java %d{yyyy-MM-dd HH:mm:ss,SSS}{GMT} %p %t %c %M - %m%n
Logmanager_IP_address is IP address your Logmanager server. -
Restart Java application to load new configuration file.
-
Now continue to configure classifiers and parser on the Logmanager server.
-
You need to find the configuration file for Log4j2 in the Java application. Most often is saved as
logging.properties
file orlog4j2.properties
file. -
Edit configuration file:
appender.socket.type = Socket appender.socket.name = socket appender.socket.host = <Logmanager_IP_adresa> appender.socket.port = 514 appender.socket.protocol = UDP appender.socket.layout.type = PatternLayout appender.socket.layout.pattern = ${hostName} java %d{yyyy-MM-dd HH:mm:ss,SSS}{GMT} %p %t %c %M - %m%n rootLogger.level = debug rootLogger.appenderRef.socket.ref = socket
Logmanager_IP_address is IP address your Logmanager server. -
Restart Java application to load new configuration file.
-
Now continue to configure classifiers and parser on the Logmanager server.