Spiros
Spiros

Reputation: 49

WSO2 Api Manager log Http request in log mediator

Is there a way to include the http request remote host in the log mediator being used for a specific api?

Having followed the instructions, i can log the soap message, but i have no info regarding the caller of the service.

I currently use the following sequence definition:

<sequence xmlns="http://ws.apache.org/ns/synapse" name="WSO2AM--Ext--In">
    <log level="full">
        <property name="TRACE" value="Gunet Mediation Extension"/>
    </log>
</sequence>

And the result i get when having a call is the following:

INFO - LogMediator To: /SmartSearch/1, WSAction: urn:SearchStudentStatus, SOAPAction: urn:SearchStudentStatus, MessageID: urn:uuid:36f9a5cd-c8cb-4e1e-97a6-f3ebd3303589, Direction: request, TRACE = Gunet Mediation Extension, Envelope: <?xml version='1.0' encoding='utf-8'?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><SearchStudentStatus xmlns="gunet.gr"><SSN>12312312312</SSN><institution>aueb</institution></SearchStudentStatus></S:Body></S:Envelope>

I would like to have information about the remote host that made the specific call. Is that possible, using the log mediator, or should i use a combination of log4j configs?

Thanks!

Upvotes: 2

Views: 1476

Answers (1)

Abimaran Kugathasan
Abimaran Kugathasan

Reputation: 32458

You can get the remote IP which call the API using following property mediator.

<log level="full">
   <property name="Actual Remote Address" expression="get-property('axis2','REMOTE_ADDR')"/>
</log>

Upvotes: 2

Related Questions