WSO2 Api Manager在日志调解器

时间:2016-04-19 12:57:06

标签: wso2 wso2-am

是否有办法将http请求远程主机包含在用于特定API的日志中介中?

按照说明操作后,我可以记录肥皂信息,但我没有关于服务呼叫者的信息。

我目前使用以下序列定义:

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

接听电话时得到的结果如下:

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>

我想了解有关拨打特定电话的远程主机的信息。这是可能的,使用日志中介,还是应该使用log4j配置的组合?

谢谢!

1 个答案:

答案 0 :(得分:2)

您可以使用以下属性介体获取调用API的远程IP。

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