How do you insert a newline in message body of mule logger component

GarySharpe picture GarySharpe · Mar 6, 2013 · Viewed 15.5k times · Source

Can anyone tell me how to insert a new line in the message of a mule logger component?

For example, I have the following in the message for the logger:

Payload is: #[payload] 
Inbound Headers:  #[headers:INBOUND:*] 
Outbound Headers:  #[headers:OUTBOUND:*]  
Exceptions:  #[exception]

I'd like to insert a new line after each of the above. I've tried just adding \n to the end of each line, but that didn't work.

Answer

David Dossot picture David Dossot · Mar 6, 2013

Use MEL:

    <logger
        message="#['Payload is:'+payload+'\nInbound Headers: '+message.inboundProperties.entrySet()+'\nOutbound Headers: '+message.outboundProperties.entrySet()+'\nExceptions: '+exception]"
        level="INFO" />