WSO2将属性排除在日志中

发布于 2025-01-31 18:46:26 字数 996 浏览 5 评论 0原文

我是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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

无人问我粥可暖 2025-02-07 18:46:26

我认为默认情况下它不适合。您可以编写自定义调解器来记录必要的属性和属性

Its not posible by default i think. You can write your custom mediator for logging necessary attributes and properties

定格我的天空 2025-02-07 18:46:26

默认情况下,&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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文