WSO2 Api Manager 在日志中介器中记录 Http 请求

2024-02-22

有没有办法将 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 配置的组合?

Thanks!


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

<log level="full">
   <property name="Actual Remote Address" expression="get-property('axis2','REMOTE_ADDR')"/>
</log>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

WSO2 Api Manager 在日志中介器中记录 Http 请求 的相关文章

随机推荐