How to print Payload as a string using Mule 4 Logger component
Many of us are habituated to use #[message.payloadAs(String)] to print the payload using the logger component. As this is no longer supported by the Logger component in Mule 4 version, The below expression can be used to print payload using the Mule 4 logger component.
#["Payload after transformation: " ++ write(payload, "text/plain")] (or)
#["JSON Output: " ++ write(payload, "application/json")] (or)
#[message.payload as String]
0 Comments