Hi Bernard,

Log Mediator is conditionally content-aware. That means, it is
either content-aware or content-unaware based on the configuration. Here,
the *custom* log with the expression *$body* is content-unaware therefore
it does not build the message. If the message is not built already, the
body is empty. Therefore you don't see the payload. If you have any content
aware mediator before this custom log, it will log the body.
But the log mediator with level *full* is content-aware since it is
expected to log the message. Therefore it builds the message and log.

Thanks

On Wed, Dec 12, 2018 at 4:53 PM Bernard Paris <[email protected]>
wrote:

> Hi,
>
> could some one explain why this differences between these 2 log
> statements, the one just preceding the second ? In other words why is body
> first empty then not, with absolutely NO treatment between the 2 logs.
>
> <log category="DEBUG" description="DEBUG" level="custom">
>      <property expression="$body" name="______ BODY ______"/>
> </log>
> <log level="full" />
>
> By the way, why is the first $body not containing incoming datas ?
>
> Results in the logs:
>
> [2018-12-12 12:04:13,531] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >> "POST /toto/v1/tat/status?echo=zaza HTTP/1.1[\r][\n]"
> [2018-12-12 12:04:13,531] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >> "Host: localhost:8280[\r][\n]"
> [2018-12-12 12:04:13,531] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >> "User-Agent: curl/7.54.0[\r][\n]"
> [2018-12-12 12:04:13,531] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >> "Accept: */*[\r][\n]"
> [2018-12-12 12:04:13,531] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >> "Content-type: text/xml[\r][\n]"
> [2018-12-12 12:04:13,532] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >> "Content-Length: 97[\r][\n]"
> [2018-12-12 12:04:13,532] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >> "[\r][\n]"
> [2018-12-12 12:04:13,532] [EI-Core] DEBUG - wire HTTP-Listener I/O
> dispatcher-2 >>
> "<students><rn>25010100314</rn><rn>25010100215</rn><rn>123456</rn><anac>20182919</anac></students>"
> ….blabla...
> [2018-12-12 12:04:13,534] [EI-Core] DEBUG - LogMediator Start : Log
> mediator
> [2018-12-12 12:04:13,534] [EI-Core] DEBUG - LogMediator ______ BODY ______
> = <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope
> /"/>
> [2018-12-12 12:04:13,534] [EI-Core] DEBUG - LogMediator End : Log mediator
> [2018-12-12 12:04:13,534] [EI-Core] DEBUG - SequenceMediator Building
> message. Sequence <SequenceMediator> is content aware
> [2018-12-12 12:04:13,535] [EI-Core] DEBUG - LogMediator Start : Log
> mediator
> [2018-12-12 12:04:13,535] [EI-Core]  INFO - LogMediator To:
> /etnic/v1/sape/statutDemande?echo=zaza, MessageID:
> urn:uuid:2156e960-4083-44a6-ba06-c79c9241efa0, Direction: request,
> Envelope: <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope
> /"><soapenv:Body><students><rn>25010100314</rn><rn>25010100215</rn><rn>123456</rn><anac>20182919</anac></students></soapenv:Body></soapenv:Envelope>
> [2018-12-12 12:04:13,535] [EI-Core] DEBUG - LogMediator End : Log mediator
>
> Thanks
> Bernard
> _______________________________________________
> Dev mailing list
> [email protected]
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>


-- 
Shakila Sasikaran
Software Engineer
Mobile :+94 (0) 77 526 6848
[email protected]
WSO2, Inc.
lean . enterprise . middleware
http://www.wso2.com/
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to