WSO2 ESB如何查看序列日志

时间:2014-12-29 17:56:42

标签: wso2 wso2esb

我在WSO2 ESB中编写了一个代理。使用日志文件或监视器功能我可以在inSequence序列介体中看到所有消息中介的日志,但是我找不到outSequence的日志。我的代理示例是:

 <proxy name="FlightStatusService"
          transports="https http"
          startOnLoad="true"
          trace="enable">
      <description/>
      <target>
         <inSequence>
            <property name="FORCE_SC_ACCEPTED" value="true" scope="axis2"/>
            <property name="OUT_ONLY" value="true"/>
            <property name="TIME_1"
                      expression="get-property('SYSTEM_TIME')"
                      scope="default"
                      type="LONG"/>
            <property xmlns:air="http://airline.services.esb.wso2.packt.com"
                      name="airlineInTransport"
                      expression="fn:concat('Airline Company - ', //air:updateStatus/air:airline)"
                      scope="transport"/>
            <property name="airlineInDefault"
                      expression="get-property('transport','airlineInTransport')"
                      scope="default"/>
            <switch xmlns:air="http://airline.services.esb.wso2.packt.com"
                    source="//air:updateStatus/air:airline">
               <case regex="EK">
                  <event topic="flightStatus/emirates"/>
               </case>
               <case regex="AA">
                  <event topic="flightStatus/aa"/>
               </case>
               <case regex="DL">
                  <event topic="flightStatus/delta"/>
               </case>
               <default>
                  <log level="custom">
                     <property name="noAirline" value="There is no Airline with these letters"/>
                  </log>
               </default>
            </switch>
         </inSequence>
         <outSequence>
            <property name="TIME_2"
                      expression="get-property('SYSTEM_TIME')"
                      scope="default"
                      type="LONG"/>
            <script language="js">var time1 = mc.getProperty("TIME_1");
var time2 = mc.getProperty("TIME_2");
var timeTaken = time2 - time1;
print("--------------  " + timeTaken + " ms  -----------------");
mc.setProperty("RESPONSE_TIME", timeTaken);</script>
            <log level="full" category="DEBUG">
               <property name="airlineInTransport"
                         expression="get-property('default', 'airlineInDefault')"/>
               <property name="Time Duration in ms: " expression="get-property('RESPONSE_TIME')"/>
            </log>
            <send/>
         </outSequence>
    </proxy>

1 个答案:

答案 0 :(得分:2)

由于您的代理支持OUT_ONLY活动,因此outSequence不会受到影响。

已编辑 - &gt;添加了代理参考

请参阅代理

<proxy name="FlightStatusService"
              transports="https http"
              startOnLoad="true"
              trace="enable">
          <description/>
          <target>
             <inSequence>
                <property name="TIME_1"
                          expression="get-property('SYSTEM_TIME')"
                          scope="default"
                          type="LONG"/>
                <property xmlns:air="http://airline.services.esb.wso2.packt.com"
                          name="airlineInTransport"
                          expression="fn:concat('Airline Company - ', //air:updateStatus/air:airline)"
                          scope="transport"/>
                <property name="airlineInDefault"
                          expression="get-property('transport','airlineInTransport')"
                          scope="default"/>
                <switch xmlns:air="http://airline.services.esb.wso2.packt.com"
                        source="//air:updateStatus/air:airline">
                   <case regex="EK">
                      <event topic="flightStatus/emirates"/>
                   </case>
                   <case regex="AA">
                      <event topic="flightStatus/aa"/>
                   </case>
                   <case regex="DL">
                      <event topic="flightStatus/delta"/>
                   </case>
                   <default>
                      <log level="custom">
                         <property name="noAirline" value="There is no Airline with these letters"/>
                      </log>
                   </default>
                </switch>
                <loopback/>
             </inSequence>
             <outSequence>
                <property name="TIME_2"
                          expression="get-property('SYSTEM_TIME')"
                          scope="default"
                          type="LONG"/>
                <script language="js">var time1 = mc.getProperty("TIME_1");
    var time2 = mc.getProperty("TIME_2");
    var timeTaken = time2 - time1;
    print("--------------  " + timeTaken + " ms  -----------------");
    mc.setProperty("RESPONSE_TIME", timeTaken);</script>
                <log level="full" category="DEBUG">
                   <property name="airlineInTransport"
                             expression="get-property('default', 'airlineInDefault')"/>
                   <property name="Time Duration in ms: " expression="get-property('RESPONSE_TIME')"/>
                </log>
                <send/>
             </outSequence>
        </proxy>