Contact Free trial Login


log(String, T): T

Logs the specified value with an optional prefix, then returns the value unchanged. The function logs the output as a system log.

This function can be used to debug DataWeave scripts until a proper debugger is incorporated.


Name Description


A string that typically describes the log.


The value to log.


This example produces the output shown below in a Logger (through the Mule LoggerMessageProcessor), while the Mule DefaultLoggingService prints My Age - 33 in the console output.


%dw 2.0
output application/xml
var myvar = { "age" : 33 }
{ "age": log("My Age", myvar.age) }


<?xml version="1.0" encoding="UTF-8"?>

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.