用户友好的日志

时间:2017-03-29 08:52:48

标签: wso2 wso2esb wso2developerstudio

我们在Developer Studio中开发了一个项目,一切正常,我们的自定义日志在Carbon日志中创建自定义消息。我们的要求是我们的自定义日志应该写在一个单独的文件中,例如“接口例外报告”和#39;这样用户就可以轻松跟踪错误而不是查看整个Carbon日志,因为它也有太多的内容。

目前,我们的自定义日志源代码如下:

<property xmlns:ns11="http://xmlns.oracle.com/apps/scm/doo/decomposition/receiveTransform/receiveSalesOrder/model/"
                   name="OrderNumber"
                   expression="//ns11:OrderNumber"
                   scope="default"
                   type="STRING"/>
         <property xmlns:ns11="http://xmlns.oracle.com/apps/scm/doo/decomposition/receiveTransform/receiveSalesOrder/model/"
                   name="OrderStatus"
                   expression="//ns11:OrderStatus"
                   scope="default"
                   type="STRING"/>
         <property xmlns:ns11="http://xmlns.oracle.com/apps/scm/doo/decomposition/receiveTransform/receiveSalesOrder/model/"
                   name="ReturnStatus"
                   expression="//ns11:ReturnStatus"
                   scope="default"
                   type="STRING"/>
         <log level="custom">
            <property name="prop1" expression="get-property('OrderNumber')"/>
            <property name="prop2" expression="get-property('OrderStatus')"/>
         </log>
         <filter source="get-property('ReturnStatus')" regex="SUCCESS">
            <then>
               <log level="custom">
                  <property name="message" value="Your order has been created successfully "/>
               </log>
            </then>
            <else>
               <log level="custom">
                  <property name="errormessage" value="Sorry,there was an issue in order creation"/>
               </log>
            </else>
         </filter>

1 个答案:

答案 0 :(得分:0)

您正在寻找的内容如 per service loggingper api logging