Salesforce

How to Enable Wire Logging for Mule Agent

« Go Back

Information

 
Content

VERSION

1.6.0 or greater

GOAL

You would like to have the Mule Agent log every HTTP transaction for troubleshooting purposes.
This is useful when you are having an issue with the communication between your runtime and Anypoint Runtime Manager. For example, you have registered and successfully started your runtime, but you don't see it as running on the platform, so you need to see what's going on with the communication to spot anything that may be disturbing it, like an overly restrictive security setting on your infrastructure.

PROCEDURE

You will have to edit your system log configuration settings, which is the file called log4j2.xml and located in the <MULE_HOME>/conf directory ( Mule Runtime's home installation directory ). Just add the following lines in the Loggers section:

Mule 3:

<AsyncLogger name="com.mulesoft" level="DEBUG"/>
<AsyncLogger name="com.mulesoft.agent" level="TRACE"/>

Mule 4:

<Loggers>
    ...
    <!-- Agent wire logging -->
    <AsyncLogger name="com.mulesoft.agent" level="TRACE"/>
    ...
</Loggers>


Then restart Runtime.

This will start logging in your mule_ee.log file messages like the following:

DEBUG 2016-06-30 13:21:47,117 [WrapperListener_start_runner] com.mulesoft.agent.transport.WebSocketAgentTransport: Sending notification: PUT applications/default/deployment
TRACE 2016-06-30 13:21:47,117 [WrapperListener_start_runner] com.mulesoft.agent.transport.WebSocketAgentTransport: Full notification: PUT applications/default/deployment HTTP/1.1
Content-Type: application/json
Content-Length: 104
Content-Encoding: UTF-8
{"status":"DEPLOYED","message":"","application":{"name":"default","domain":"default","state":"STARTED"}}
DEBUG 2016-06-30 13:21:48,346 [pool-21-thread-1] com.mulesoft.agent.transport.WebSocketAgentTransport: Sending notification: POST keepAlive
TRACE 2016-06-30 13:21:48,347 [pool-21-thread-1] com.mulesoft.agent.transport.WebSocketAgentTransport: Full notification: POST keepAlive HTTP/1.1
DEBUG 2016-06-30 13:21:48,364 [WrapperListener_start_runner] com.mulesoft.agent.transport.WebSocketAgentTransport: Sending notification: POST startup
TRACE 2016-06-30 13:21:48,365 [WrapperListener_start_runner] com.mulesoft.agent.transport.WebSocketAgentTransport: Full notification: POST startup HTTP/1.1
Content-Type: application/json
Content-Length: 319
Content-Encoding: UTF-8
{"addresses":"[{\"ip\":\"10.8.9.50\",\"networkInterface\":\"en1\"},{\"ip\":\"127.0.0.1\",\"networkInterface\":\"lo0\"}]",
 "domains":"[{\"applications\":[{\"domain\":\"default\",\"state\":\"STARTED\",\"name\":\"default\"},{\"domain\":\"default\",\"state\":\"STARTED\",\"name\":\"SecureService\"}],\"name\":\"default\"}]"}

Since this is a very verbose logging, you will want to remove it after finished debugging.

Note: Enabling this does not have any kind of negative impact, it only adds more data from an agent standpoint.

Attachments

Powered by