Mule Logger无法解析#[payload]或流变量

时间:2016-08-04 13:54:12

标签: logging mule

 The logger statements always logs #[payload} or message.payload. In  other words the variables are never resolved.  

为什么记录器始终打印未解析的变量?

 log4j.rootLogger=DEBUG, R


      log4j.appender.R = org.apache.log4j.RollingFileAppender进行       log4j.appender.R.File = $ {} mule.home /logs/App.log       log4j.appender.R.MaxFileSize = 10MB

  log4j.appender.R.MaxBackupIndex=10
  log4j.appender.R.append=true
  log4j.appender.R.layout=org.apache.log4j.PatternLayout
  log4j.appender.R.layout.ConversionPattern=%-5p %d [%t] %c: %m%n
  log4j.logger.org.apache=WARN, R
  log4j.additivity.org.apache=false

       log4j.logger.org.springframework.beans.factory = WARN,R        log4j.logger.org.springframework.beans。        GenericTypeAwarePropertyDescriptor = ERROR,R       log4j.logger.org.springframework.context.support = WARN,R        log4j.logger.org.springframework = ERROR,R

  log4j.logger.org.mule=DEBUG, R
  log4j.logger.com.mulesoft=DEBUG, R
   log4j.logger.com.mulesoft.mule.cluster.boot=ERROR, R
  log4j.logger.org.apache.commons.httpclient=WARN, R
  log4j.logger.org.apache.commons.beanutils.converters=WARN, R
  log4j.logger.org.apache.commons.beanutils.ConvertUtils=WARN, R
  log4j.logger.org.mule.config.spring.parsers.assembly=OFF,R



     <flow name="MainFlow"
     processingStrategy="synchronous">
      <vm:inbound path="in.queue"/>
      <request-reply doc:name="Request-Reply">
        <vm:outbound-endpoint exchange-pattern="one-way"
            path="order.validation" doc:name="VM" />
        <vm:inbound-endpoint exchange-pattern="one-way"
            path="order.validation.result" doc:name="VM" />
      </request-reply>


     <set-property propertyName="validationValue" value="#

      [message.inboundProperties.validationResult]" 
          doc:name="Set Validation Result" />

     <logger
       message="Result -mesage.inboundProperties.validationResult]"
       level="INFO"
         doc:name="Validation Variable" />
     <logger
    message="Message Payload ==&gt;  #[flowVars.validationValue]"
    level="INFO"
    doc:name="Logger" />



      <logger
      message="Message Payload ==&gt; #[message.payload] or #[payload]"
     level="INFO"
      doc:name="Logger" />




     <catch-exception-strategy doc:name=" App Exception">
        <logger
            message="Main Processing flow - #[message] :: 
                   ExceptionSummary::= #[exception.summaryMessage]"
            level="ERROR" doc:name="Logger"  />
      </catch-exception-strategy>
      </flow>



  <flow name="Order.Validation.flow" >
        <vm:inbound-endpoint exchange-pattern="one-way"
            path="order.validation" doc:name="VM" />
         <component doc:name="Java">
            <spring-object bean="ValidateOrderBean" />
        </component>
         <set-property propertyName="validationResult" 
            value="#[flowVars.result]" doc:name="Property"/>
  </flow>

1 个答案:

答案 0 :(得分:0)

尝试连接字符串内部MEL,像这样 -

<logger
      message="#['Message Payload ==>' + payload]"
     level="INFO"
      doc:name="Logger" />