With the log mediator, you can log messages being mediated.
Log Mediator supports following log categories.Log messages will be logged in log4j with selected log category. The default log category is INFO
Log mediator has four log levels
A separator if defined will be used to separate the attributes being logged. The default separator is the ',' comma
With properties, user can choose any other attributes that they want to log. Imagine there is an element carrying the transaction id in the SOAP body. User can use a XPath expression to extract out this transaction id element and log it using the log mediator. It is possible to define several such properties to be logged.
If properties are specified with any of the first three log levels, custom properties will be logged along with the default ones.
<log [level="string"] [separator="string"]> <property name="string" (value="literal" | expression="xpath")/>* </log>
Figure1: Log Mediator
You can select the log category to be one of following values.
You can select the log level to be one of following values.
The log separator is used to separate the attributes being logged. The default separator is ',' (comma).
You can add custom messages to log as the messages mediate thorough the log mediator.
Figure2: Log Mediator Properties
<log level="custom" xmlns="http://ws.apache.org/ns/synapse"> <property name="text" expression="fn:concat('Stock price - ',get-property('stock_price'))"/> </log>
In this example log level is set to custom. It logs the property stock_price that is set previously in the message mediation.
<log level="full" xmlns="http://ws.apache.org/ns/synapse"/>
In the previous example it logs evething including the full SOAP message.