Is it possible to configure a Camel route to send a message to a specific log4j logger? For example, I have the following logger:
<logger name="com.me.log.mylogger" additivity="false">
<level value="debug" />
<appender-ref ref="file_appender_messages" />
</logger>
file_appender_messages is just a RollingFileAppender.
I then try to log it using the following in my Camel context:
<to uri="log:com.me.log.mylogger?level=INFO" />
But it outputs on the command line instead of the log file specified in file_appender_messages:
25-Oct-2012 11:46:44 org.apache.camel.processor.CamelLogger log
INFO: [MESSAGE BODY]
I would like to be able to use dffferent loggers for messages from different sources. I could do it in my message processors but ideally it could be configured in the route xml. Can it be done?
I fixed this by defining the Logger as a Bean in my application XML file
Then in my route, when I want to log the message I just direct it to the relevant method on the Bean