Use of Logging Proxy within WSO2 ESB


Use of  Logging Proxy within WSO2 ESB

This blog post will show how a login proxy can be created with wso2esb. First click on the Add >Proxy services option, this will load a screen as similar to below. From this select Logging Proxy. Basically this proxy creation enables the creation of log outputs that prints on the console.



As shown in the image below fill the following fields as shown

Proxy service name: a unique value to identify the proxy.

Target URL : the target URL of the back end service.

Request Log Level : what level of logging details do we need to generate for request received (Full/Simple/None)

Response Log Level : what level of logging details do we need to generate for response generated (Full/Simple/None)

WSDL URL: The URL of the wsdl file for the back end service is entered hear.

Once the above details are entered, generate a request from the SoapUI as shown below


The output from the logs when "Full" log level is selected will be similar to below:

[2013-12-04 16:27:03,905]  INFO - LogMediator To: /services/Logging_Proxy.Logging_ProxyHttpSoap11Endpoint, WSAction: urn:greet, SOAPAction: urn:greet, MessageID: urn:uuid:bf890e3c-5f4a-4f02-9afb-6c553c65a877, Direction: request, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:typ="http://www.wso2.org/types"><soapenv:Body>
      <typ:greet>
         <!--Optional:-->
         <name>?</name>
      </typ:greet>
   </soapenv:Body></soapenv:Envelope>
[2013-12-04 16:27:03,913]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:fb1bc809-5688-41d4-98d9-66b818667a12, Direction: response, Envelope: <?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body><ns:greetResponse xmlns:ns="http://www.wso2.org/types"><return>Hello World, ? !!!</return></ns:greetResponse></soapenv:Body></soapenv:Envelope>

If we have selected "Simple as the log level the output generated from the logs will be similar to below

[2013-12-04 16:28:53,513]  INFO - LogMediator To: /services/Logging_Proxy.Logging_ProxyHttpSoap11Endpoint, WSAction: urn:greet, SOAPAction: urn:greet, MessageID: urn:uuid:a772944b-1055-4b16-a345-c5d1ac900fa8, Direction: request

[2013-12-04 16:28:53,520]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:53d5a08d-b896-4432-a1a8-f7dc4414d59f, Direction: response

 

Comments