如何在Mule logger组件的消息正文中插入换行符 [英] How do you insert a newline in message body of mule logger component

查看:293
本文介绍了如何在Mule logger组件的消息正文中插入换行符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以告诉我如何在m子记录器组件的消息中插入新行吗?

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]

我想在上述各项之后插入新行.我尝试只在每行的末尾添加\ n,但这没用.

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.

推荐答案

使用MEL:

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

这篇关于如何在Mule logger组件的消息正文中插入换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆