THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block | ||||
---|---|---|---|---|
| ||||
<bean id="myLogger" class="org.slf4j.LoggerFactory" factory-method="getLogger" xmlns="http://www.springframework.org/schema/beans"> <constructor-arg value="com.mycompany.mylogger" /> </bean> <route id="moo" xmlns="http://camel.apache.org/schema/spring"> <from uri="direct:moo"/> <log message="Me Got ${body}" loggingLevel="INFO" loggerRef="myLogger"/> <to uri="mock:baz"/> </route> |
Configuring log name globally
Available as of Camel 2.17
By default the log name is the route id. If you want to use a different log name, you would need to configure the logName option. However if you have many log's and you want all of them to use the same log name, then you would need to set that logName option on all of them.
With Camel 2.17 onwards you can configure a global log name that is used instead of the route id, eg
Code Block |
---|
CamelContext context = ...
context.getProperties().put(Exchange.LOG_EIP_NAME, "com.foo.myapp"); |
And in XML
Code Block | ||||
---|---|---|---|---|
| ||||
<camelContext ...>
<properties>
<property key="CamelLogEipName" value="com.foo.myapp"/>
</properties> |
Using slf4j Marker
Available as of Camel 2.9
...