WSO2将属性排除在日志中
我是WSO2的新手,我想记录传入请求中的所有属性,除了一个属性 这是我的代码:
<log level="full"/>
<propertyGroup>
<property expression="json-eval($.username)" name="Username" scope="default" type="STRING"/>
<property expression="json-eval($.password)" name="Password" scope="default" type="STRING"/>
<property expression="json-eval($.objectStore)" name="ObjectStore" scope="default" type="STRING"/>
<property expression="json-eval($.documentClass)" name="DocumentClass" scope="default" type="STRING"/>
<property expression="json-eval($.fileName)" name="FileName" scope="default" type="STRING"/>
<property expression="json-eval($.fileData)" name="FileData" scope="default" type="STRING"/>
<property expression="json-eval($.contentType)" name="ContentType" scope="default" type="STRING"/>
</propertyGroup>
我想从日志中排除FileData属性,因为它的base64
除了自定义日志外,还有其他解决方案,它只有我要登录的属性吗?
I am new to wso2 and I want to log all the properties in the incoming request except one property
here's my code:
<log level="full"/>
<propertyGroup>
<property expression="json-eval($.username)" name="Username" scope="default" type="STRING"/>
<property expression="json-eval($.password)" name="Password" scope="default" type="STRING"/>
<property expression="json-eval($.objectStore)" name="ObjectStore" scope="default" type="STRING"/>
<property expression="json-eval($.documentClass)" name="DocumentClass" scope="default" type="STRING"/>
<property expression="json-eval($.fileName)" name="FileName" scope="default" type="STRING"/>
<property expression="json-eval($.fileData)" name="FileData" scope="default" type="STRING"/>
<property expression="json-eval($.contentType)" name="ContentType" scope="default" type="STRING"/>
</propertyGroup>
I want to exclude the fileData property from log because it's base64
is there's any solution other than a custom log that has only the properties that I want to log ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为默认情况下它不适合。您可以编写自定义调解器来记录必要的属性和属性
Its not posible by default i think. You can write your custom mediator for logging necessary attributes and properties
默认情况下,
&lt; log Level =“ full”/&gt;
不会记录您的属性 - 它是日志记录标准标头(即,到,从,来自,来自WSACTION,WSACTION,SOAPACTION,REPLYTO和MESSEADSID)和消息的完整有效载荷。正如我在您的示例中看到的那样 -json -eval($。fileedata)
是JSON有效载荷的一部分。因此,除了使用自定义记录器之外,别无选择。
By default, the
<log level="full"/>
won't log your property - it is logging standard headers (i.e. To, From, WSAction, SOAPAction, ReplyTo, and MessageID) and the full payload of the message. And as i see in your example -json-eval($.fileData)
is part of the JSON payload.So, there is no other option than using a custom logger.