0

I use apache camel mail service and I have a lot of logs:

(certificates data..)
camel (camel-1) thread #0 - (...) Application Data, length = 31
Camel (camel-1) thread #0 - (...) Application Data, length = 39
Camel (camel-1) thread #0 - (...) Application Data, length = 31
Camel (camel-1) thread #0 - (...) Application Data, length = 39

which are not appended by LOG4J or smth, but directly to console. I can't filter this logs.

This: log4j.category.org.apache.camel=INFO works for camels logs, I tried also with camelContext.setTracing(false); but it looks this logs comes from somewhere else.

Is it possible to disable logging this kind of information ?

Update - route url

"imaps://"
            + e.getHost()
            + "?username="
            + e.getUsername()
            + "&password="
            + getPassword(e)
            + "&folderName="
            + e.getInboxFolder()
            + "&unseen=false&consumer.initialDelay=10000&consumer.delay=300&peek=true&searchTerm.fromSentDate=now-5s&closeFolder=false";

Log4j configuration

### direct log messages to stdout ###
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d %5p %c{1}:%L - %m%n
log4j.rootLogger=FATAL, stdout

log4j.logger.org.hibernate=WARN
log4j.logger.org.hibernate.type=WARN

log4j.logger.org.springframework=INFO
log4j.category.org.springframework.web=WARN
log4j.category.org.springframework.web.socket=WARN
log4j.category.org.springframework.messaging=WARN
log4j.category.org.hibernate=WARN
log4j.category.net.sf.ehcache=INFO
log4j.category.org.apache.camel=INFO
log4j.logger.org.apache.camel=INFO
kxyz
  • 802
  • 1
  • 9
  • 32

2 Answers2

1

This seems to be caused by SUN Mail framework which uses java.util.logging.

Set the log level for com.sun.mail.imap package to OFF. I am not familiar with java.util.logging very well; you can find more info here.

Community
  • 1
  • 1
Dragan Bozanovic
  • 23,102
  • 5
  • 43
  • 110
0

Camel uses SLF4J for logging (http://camel.apache.org/log.html)

SLF4J is a facade for different logging implementations. Check which implementation you are using at this moment and adjust its configuration to disable logging

For example: If you have slf4j-log4j12-x.x.x.jar in your classpath, then you use LOG4J as implementation. Add log4j.xml (if you don't have it yet) and set

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
    <root>
        <priority value="FATAL" />
...
    </root>
</log4j:configuration>
Sergey
  • 1,332
  • 2
  • 18
  • 30