karim adly
karim adly

Reputation: 11

Turn off debug logs on Camel

I am trying to turn off debug logs. I followed the following steps http://camel.apache.org/how-do-i-enable-debug-logging.html

I made log level INFO, but still can see debug logs. I tried to create log4j.xml instead of log4j.properties, same issue. It doesn't seem that my configuration being picked up at all.

Update:

log file: log4j.properties

log4j.rootLogger=INFO, out 
log4j.logger.org.apache.camel=INFO

log4j.appender.out=org.apache.log4j.ConsoleAppender
log4j.appender.out.layout=org.apache.log4j.PatternLayout
log4j.appender.out.layout.ConversionPattern=[%30.30t] %-30.30c{1} %-5p

Upvotes: 1

Views: 2930

Answers (1)

Aurélien Gamet
Aurélien Gamet

Reputation: 11

I just had the same problem of being unable to configure log4j while using Camel. It was caused by the fact that there were several slf4j bindings in the classpath, and in my case slf4j chose logback over log4j.

If you encounter this issue, look for these around the beginning of the log:

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

The quick & dirty way to solve the problem is to create a configuration file for every potential bindings found. The clean way is to find what dependency imports the unwanted binding; and configure your dependency manager so that only the binding of your choosing is bundled with your app.

See http://www.slf4j.org/codes.html#multiple_bindings for more details.

Upvotes: 1

Related Questions