This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

All docs This doc

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In the springCustomLogger.xml file, define the Spring bean:

Code Block
languagehtml/xml
<!DOCTYPE beans PUBLIC  "-//SPRING//DTD BEAN//EN"
    "http://www.springframework.org/dtd/spring-beans.dtd">

<beans>

   <bean id="springtest" class="samples.mediators.extensions.SpringCustomLogger" singleton="false">
	   <property name="username"><value>"Synapse User"</value></property>
	   <property name="email"><value>"[email protected]"</value></property>
   </bean>

</beans>

Prerequisites:

  • Enable logging for the samples.mediators package by adding the following line to the <ESB<EI_HOME>/repository/conf/log4j.properties file:
    log4j.category.samples.mediators=INFO
  • Deploy the SimpleStockQuoteService in the sample Axis2 server and start it on port 9000.
  • Start the ESB with sample configuration 470 as follows: wso2esb-samples -sn 470

In this sample, the Spring Bean SpringCustomLogger gets initialized using the springCustomLogger.xml file and then logs the message ID. Invoke the client as follows:

Code Block
ant stockquote -Daddurl=http://localhost:9000/services/SimpleStockQuoteService -Dtrpurl=http://localhost:8280/

If you have successfully enabled logging for the samples.mediators package, you will see an output similar to the following on the console:

Code Block
    2010-09-26 20:46:57,946 [-] [HttpServerWorker-1]  INFO SpringCustomLogger Starting Spring Meditor
    2010-09-26 20:46:57,946 [-] [HttpServerWorker-1]  INFO SpringCustomLogger Bean in Initialized with User:["Synapse User"]
    2010-09-26 20:46:57,946 [-] [HttpServerWorker-1]  INFO SpringCustomLogger E-MAIL:["[email protected]"]
    2010-09-26 20:46:57,946 [-] [HttpServerWorker-1]  INFO SpringCustomLogger Massage Id:  urn:uuid:383FA8B27D7CC549D91285514217720
    2010-09-26 20:46:57,946 [-] [HttpServerWorker-1]  INFO SpringCustomLogger Logged....