Hi all,

we are currently discussing about how to realize our logging
requirements. We would like to receive some feedback and ideas about how
to best implement these requirements.
First of all I will briefly summarize the intent and the requirements.
Then I will provide some examples. And at the end I will raise some
concrete questions regarding the implementation.

The purpose of logging in this context is mainly traceability. Who
requested when, which service? Which destination was the request routed
to? How did the response look like? How long did it take from incoming
request to delivered response?

Now all functional/technical requirements:
- logging must be done asynchronously as it should not impact 
- logging shall be configurable either to use a file with custom layout
(separator) or a database table with custom columns
- request/response should be in a single record/line
- request shall be logged immediately (if something crashes while
request is being processed/delivered at least the request shall be in
the log)

Request information to be logged (each of them mapped to a named
field/column)
- timestamp of incoming request
- (proxy) service name
- well known (named) SOAP and HTTP-Header attributes
- it must be possible to concatenate all remaining SOAP and HTTP-Header
attributes (which are not known by name) as separated name/value-pairs
to a field/column

Routing information (each of them mapped to a named field/column)
- destination protocol
- destination IP
- destination port
- destination path
- endpoint name/registry key name (though redundant, would be nice to
have that too, if possible)

Response information (each of them mapped to a named field/column)
- HTTP-return code
- fault info, maybe faultcode and faultstring (if applicable)
- response time


Now a short example and how the information should look inside a
database table.

Please consider we have a service residing on the following endpoint:
http://localhost:8888/remoting/service/CatalogTestService
configured as an endpoint with name " catalog_1.1_prerelease " insight
synapse.
The proxy service which uses this endpoint (based on a routing decision,
e.g. a value from a SOAP header) might have the name "catalog".

A sample request could look like this

<soapenv:Envelope 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:esb="http://esb.jamba.net/";
xmlns:syn="http://ws.apache.org/namespaces/synapse";>
   <soapenv:Header>       
       <esb:version>1.0</esb:version>
       <esb:clientIdentification>[EMAIL PROTECTED]</esb:clientIdentification>
       <esb:country>de</esb:country>
         <esb:brand>xyz</esb:brand>
       <syn:ClientID>sessionId_4711</syn:ClientID>
   </soapenv:Header>
   <soapenv:Body>
      <!-- removed to keep this short -->
   </soapenv:Body>
</soapenv:Envelope>

Version and clientIdentification shall be considered as mandatory
parameters known by name. Country and brand are examples for optional
parameters (specific to a concrete service). ClientID again is a known
parameter used by synapse to "track sessions" (stickiness).


A possible response might look like that and be delivered to the client
10 ms after the incoming request. In this case it represents a fault due
to some problem with the server which hosts the service:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Server</faultcode>
         <faultstring>Some error description</faultstring>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

So the following data should be logged 
(I'll write them down as COLUMN_NAME: value)

req_arrived_at: 24.05.2007 15:01:01,221 (some timestamp)
req_client_id: [EMAIL PROTECTED]
req_service_name: catalog
req_service_version: 1.1
req_opt_parameters: country="de";brand="xyz"
dest_name: catalog_1.1_prerelease
dest_protocol: http
dest_ip: 127.0.0.1
dest_port: 8888
dest_path: /remoting/service/CatalogTestService
res_http_status: 500
res_faultcode: saop:Server
res_faultstring: Some error description
res_time: 10


And now my questions: :-)

- Which of these requirements are covered with the current
implementation and which are not?

- How can we improve the current implementation to meet these
requirements? Where shall one start? 

- Do we need to have some kind of AsyncLog-Mediator in the incoming AND
the outgoing sequence? 

- Is it possible to use only one record for a request/response pair (do
an insert in the incoming sequence and an update in the outgoing
sequence)? How to identify a message uniquely in a cluster environment?

- Do you have any other hints on how to solve the requirements?


Regards,
   Eric

_______________________________________________
Esb-java-user mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Reply via email to