How to add logger in Apache Camel routes

Yes, we can log messages from Camel route, and can define different log levels for each log message. In order to add logger, first you need to add required additional dependencies to your application. <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> <version>1.2</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.17</version> </dependency> Then add log4j.properties or log4j.xml to the application classpath. log4j.properties log4j.rootLogger=INFO, out log4j.appender.out=org.apache.log4j.ConsoleAppender log4j.appender.out.layout=org.apache.log4j.PatternLayout Read More…