Skip to content

How to configure WSO2 to send logs to CYBERQUEST server IP Address on port 5140 UDP

In this document we will detail how to send WSO2 logs (on Windows machine) to CQ Server IP Address on port 5140.

1.Log in to the WSO2 server as Administrator

2.Edit the following file log4j2.properties. We find this file following this path:
C:\Program Files\WSO2\Identity Server\5.11.0\repository\conf

3.Add the syslog entry to the end of the line to use the syslog appender

Example:

#list of all appenders

appenders = CARBON_CONSOLE, CARBON_LOGFILE, AUDIT_LOGFILE, ATOMIKOS_LOGFILE, CARBON_TRACE_LOGFILE, DELETE_EVENT_LOGFILE, TRANSACTION_LOGFILE, osgi, syslog

4.To use the Syslog Appender follow the steps:

a) Uncomment the below lines to use the Syslog Appender:

appender.syslog.type = Syslog
appender.syslog.name = Syslog
appender.syslog.host = localhost
appender.syslog.port = 514
appender.syslog.layout.type = PatternLayout
appender.syslog.layout.pattern = [%d] [%tenantId] %5p {%c} - %mm%ex%n
appender.syslog.filter.threshold.type = ThresholdFilter
appender.syslog.filter.threshold.level = DEBUG 

b) Add the line: appender.syslog.protocol = udp

c) Change the date-time format, add ServerName and tag.

Example:

appender.syslog.layout.pattern = %d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} ServerName wso2is [%tenantId] %5p {%c} - %mm%ex%n %t

Final result, in the log4j2.properties file should contain the following lines:

appender.syslog.type = syslog

appender.syslog.name= syslog

appender.syslog.host = CQ SERVER IP

appender.syslog.port = 5140

appender.syslog.protocol = udp

appender.syslog.layout.type = PatternLayout

appender.syslog.layout.pattern = %d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX} ServerName wso2is [%tenantId] %5p {%c} - %mm%ex%n %t

appender.syslog.filter.threshold.type = ThresholdFilter

appender.syslog.filter.threshold.level = DEBUG

5.Uncomment the last line to add syslog appender to the root logger

Example:

#root loggers

rootLogger.level = INFO

rootLogger.appenderRef.CARBON_CONSOLE.ref = CARBON_CONSOLE

rootLogger.appenderRef.CARBON_LOGFILE.ref = CARBON_LOGFILE

rootLogger.appenderRef.PaxOsgi.ref = PaxOsgi

rootLogger.appenderRef.syslog.ref = syslog

6.Save the configuration file