The log4j.properties settings seem to be ignored when running mvn camel:run on a project created by one of the Camel archetypes.
Environment
- Fuse Message Router
- Log4j
Issue
The log4j.properties settings seem to be ignored when running mvn camel:run on a project created by one of the Camel archetypes. Setting the rootLogger or org.apache.camel logger to DEBUG has no effect, only INFO level log statements are logged to the console when using mvn camel:run or mvn camel:embedded.
Resolution
Add log4j as a dependency to your project, after which the logging will be properly configured by the log4j.properties file. For example, add:
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.14</version>
</dependency>
to your pom.xml.
Root Cause
The project does not have log4j as a dependency, and so the default Java logging mechanism is being used.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
