简体   繁体   English

WSO2 ESB登录代理

[英]WSO2 ESB logging in proxy

I have simple proxy with send messages to some url. 我有简单的代理,可以将消息发送到某些网址。 I would like to know when something is send through proxy, and when response is send back. 我想知道什么时候通过代理发送,什么时候响应返回。

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="SynchronizeService" transports="https http" startOnLoad="true" trace="disable">
  <target>
    <inSequence>
      <log level="simple"/>

      <send>
        <endpoint key="SynchronizeServiceEndpoint"/>
      </send>
    </inSequence>

    <outSequence>
      <log level="simple"/>

      <send/>
    </outSequence>
  </target>
</proxy>

I added log mediator but the problem is, it don't log any information which allow to connect request and response. 我添加了日志介体,但问题是,它不记录任何允许连接请求和响应的信息。 So example log looks like: 因此示例日志如下所示:

[2013-06-03 15:38:07,914]  INFO - LogMediator To: http://esb-ip:9763/services/SynchronizeService, WSAction: http://test.pl/WebService/getWorkPlan, SOAPAction: http://test.pl/WebService/getWorkPlan, ReplyTo: http://www.w3.org/2005/08/addressing/anonymous, MessageID: urn:uuid:36b60af3-dc30-4004-a239-26523774f52b, Direction: request

[2013-06-03 15:38:08,016]  INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , ReplyTo: http://www.w3.org/2005/08/addressing/anonymous, MessageID: urn:uuid:8f753934-c64a-4276-a916-dceaeda3def0, Direction: response

In logged response there is no information about SOAPAction, messageIds are different. 在记录的响应中,没有有关SOAPAction的信息,messageIds不同。 How can I connect request with response in logs? 如何连接请求和日志中的响应? I would like to known when response was send. 我想知道何时发送回复。 How can I do this? 我怎样才能做到这一点?

You did a simple log, which will log very basic info about the message. 您做了一个简单的日志,它将记录有关该消息的非常基本的信息。 Do a log level=full, that will log the full message which is passed through the system 执行log level = full,将记录通过系统传递的完整消息

I didn't know that is is possible to assign variables in input Sequence and use them in output Sequence. 我不知道可以在输入Sequence中分配变量并在输出Sequence中使用它们。 I assign messageId from input sequence and log it in output. 我从输入序列分配messageId并将其记录在输出中。 My proxy after changes looks like: 更改后我的代理如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse" name="SynchronizeService" transports="https http" startOnLoad="true" trace="disable">
    <target>
        <inSequence>
            <log level="simple"/>

            <property name="requestSysDate" expression="get-property('SYSTEM_DATE')" scope="default" type="STRING"/>
            <property name="requestMsgId" expression="get-property('MessageID')" scope="default" type="STRING"/>

            <filter xmlns:procsyn="http://test.pl/WebService/Synchronize" xpath="//procsyn:getWorkPlanIn">
                <property name="requestMethod" value="getWorkPlan" scope="default" type="STRING"/>
            </filter>

            <send>
                 <endpoint key="SynchronizeServiceEndpoint"/>
            </send>
        </inSequence>

        <outSequence>
            <log level="custom">
                <property name="proxyName" value="SynchronizeService"/>
                <property name="requestMethod" expression="get-property('requestMethod')"/>
                <property name="requestSysDate" expression="get-property('requestSysDate')"/>
                <property name="requestMsgId" expression="get-property('requestMsgId')"/>
            </log>

            <send/>
        </outSequence>
    </target>
</proxy>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM