LogPage edited by Claus IbsenLog ComponentThe log: component logs message exchanges to the underlying logging mechanism. Camel uses commons-logging which allows you to configure logging via
Refer to the commons-logging user guide for a more complete overview of how to use and configure commons-logging. URI format
log:loggingCategory[?level=loggingLevel][options]
Where loggingCategory is the name of the logging category to use and loggingLevel is the logging level such as DEBUG, INFO, WARN, ERROR - the default is INFO By default Camel uses a regular logging that logs every exchange. However Camel also ships with a Throughput logger that is used if the groupSize option is specified. Options
FormattingThe log formats the execution of exchanges to log lines. LogFormatter has the following options:
Regular logger sampleIn the route below we logs the incoming orders at DEBUG level before the order is processed.
from("activemq:orders").to("log:com.mycompany.order?level=DEBUG").to("bean:processOrder");
And using Spring DSL as the route:
<route>
<from uri="activemq:orders"/>
<to uri="log:com.mycompany.order?level=DEBUG"/>
<to uri="bean:processOrder"/>
</route>
Regular logger with formatter sampleIn the route below we logs the incoming orders at INFO level before the order is processed.
from("activemq:orders").
to("log:com.mycompany.order?showAll=true&multiline=true").to("bean:processOrder");
Throughput logger sampleIn the route below we log the throughput of the incoming orders at DEBUG level grouped by 10 messages.
from("activemq:orders").
to("log:com.mycompany.order?level=DEBUG?groupSize=10").to("bean:processOrder");
See Also
Change Notification Preferences
View Online
|
View Change
|
Add Comment
|
- [CONF] Apache Camel > Log confluence
- [CONF] Apache Camel > Log confluence
- [CONF] Apache Camel > Log confluence
- [CONF] Apache Camel > Log confluence
- [CONF] Apache Camel > Log confluence
- [CONF] Apache Camel > Log confluence
- [CONF] Apache Camel > Log confluence
- [CONF] Apache Camel > Log confluence