Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

logging from inside dataweave

Just like we use

<xsl:message> 

inside XSL transformer and

system.out.println

for datamapper, do we have any logging mechanism for dataweave ? If not a direct component, do we have any other alternate mechanisms to achieve logging from inside dataweave ?

like image 481
tortoise Avatar asked Apr 25 '16 09:04

tortoise


2 Answers

In mule 3.8 you can do it like this ,mule allows logging in dataweave

 %dw 1.0 
 %output application/json
 --- 
 {   
   result: log("Logging the array",[1,2,3,4]) 
 }

you can refer the latest document for this here

like image 188
scorpion Avatar answered Sep 19 '22 13:09

scorpion


You can take a look at my answer here - https://stackoverflow.com/a/36458835/5616671.

If you want to log every record that is being processed by dataweave map, you can change the filter function to return true always and log value before returning.

BTW, What type of logging you want to do?

like image 44
Manik Magar Avatar answered Sep 22 '22 13:09

Manik Magar