在 Apache Camel 日志中记录简单文本
问题描述:
是否可以在 Camel 中记录简单的文本,如下所示
Is is possible to log simple text in Camel as follows
<route>
<from uri="direct:cxlrefdata"/>
<to uri="log:'Hello World'" />
</route>
我想在日志中记录此消息Hello World",但我在 Apache Camel 站点中找到的所有示例都是用于记录路由消息.
I want to log this message, 'Hello World' in log, but all the examples which I find in Apache Camel site are for logging route messages.
例如
<route>
<from uri="direct:t1"/>
<to uri="log:output?showAll=true" />
</route>
我想要一些简单的东西,它可以记录测试消息.
I want something simple which can log test messages.
答
是的 查看日志 eiphttp://camel.apache.org/logeip.html
Yes see the log eip http://camel.apache.org/logeip.html
这允许您将人类可读的消息记录到日志中.您可以通过日志组件页面上的绿色提示框发现它:http://camel.apache.org/log
This allows you to log human readable messages to the log. You could have spotted it, by the green tip box on the log component page: http://camel.apache.org/log