Understanding and enabling Wire logs in WSO2-APIM-3.0.0

Lakmini Wathsala
2 min readDec 21, 2019

Why Wire logs?

The Wire logs play a major role in the troubleshooting process of the WSO2 servers. Basically, the wire logs are included all the incoming and outgoing messages of the APIM Gateway.

Also, this will again helpful for troubleshooting the mediations in the APIM Gateway as well when we added any mediation logic inside the Gateway.[1]

It is recommended to enabled the Wire logs only for the troubleshooting process as it heavily grows the log files.

How to enable it?

To enable the Wire logs in the APIM-3.0.0 is slightly different from APIM 2.x.x as APIM-3.0.0 is consist of ‘Log4j2’.

  • Open the ‘log4j2.properties’ file in <APIM-3.0.0_HOME>/repository/conf directory.
  • Make sure that the below segment has been added to that file.

logger.synapse-wire.name = org.apache.synapse.transport.http.wire

logger.synapse-wire.level = DEBUG

logger.synapse-wire.appenderRef.CARBON_LOGFILE.ref = CARBON_LOGFILE

  • Then add the ‘synapse-wire’ to the ‘loggers’ section as below.

loggers = AUDIT_LOG, trace-messages, …. correlation, synapse-wire

After these changes, you do not need to restart the server. After successfully deployed, there will be below log trace in the wso2carbon.log file.

INFO — LoggingUpdaterServiceComponent Logging configuration applied successfully

How to read and understand?

  • HTTP-Listener I/O Dispatcher-4 >>

The initial request coming from the client into the Gateway.

  • HTTP-Sender I/O Dispatcher-3 <<

The processed request going out from the Gateway to the external back-end.

  • HTTP-Sender I/O Dispatcher-3 >>

The response sent by the back-end to the Gateway.

  • HTTP-Listener I/O Dispatcher-4 <<

The response received to the client from the Gateway.

Sample Log for a token generation

--

--