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. It is typically saved as
logging.propertiesfile orlog4j.propertiesfile. -
Edit the 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%nLogmanager_IP_address is the IP address your Logmanager server. -
Restart the Java application to load the new configuration file.
-
You can now continue by configuring classifiers and parser on the Logmanager server.
-
You need to find the configuration file for Log4j2 in the Java application. It is typically saved as
logging.propertiesfile orlog4j2.propertiesfile. -
Edit the 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 = socketLogmanager_IP_address is the IP address your Logmanager server. -
Restart the Java application to load the new configuration file.
-
You can now continue by configuring classifiers and parser on the Logmanager server.