Apache的骆驼日志 [英] Apache camel logs

查看:321
本文介绍了Apache的骆驼日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Apache骆驼的邮件服务,我有很多的日志:

 (证书数据..)
骆驼(骆驼-1)线#0 - (...)应用数据,长度= 31
骆驼(骆驼1)线#0 - (...)应用数据,长度= 39
骆驼(骆驼1)线#0 - (...)应用数据,长度= 31
骆驼(骆驼1)线#0 - (...)应用数据,长度= 39

并非由LOG4J或不便追加,而是直接去安慰。
我不能过滤此日志。

本: log4j.category.org.apache.camel = INFO 适用于骆驼日志,我也试图与 camelContext.setTracing(假) ; 但看起来这个日志来自别的地方。

是否有可能禁用记录这类信息?

更新 - 航线网址

 IMAPS://
            + e.getHost()
            +?用户名=
            + e.getUsername()
            +&放大器;密码=
            + getPassword来(五)
            +&安培;文件夹名=
            + e.getInboxFolder()
            + \"&unseen=false&consumer.initialDelay=10000&consumer.delay=300&peek=true&searchTerm.fromSentDate=now-5s&closeFolder=false\";

Log4j配置

  ###直接日志消息到标准输出###
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,标准输出log4j.logger.org.hibernate = WARN
log4j.logger.org.hibernate.type = WARNlog4j.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


解决方案

这似乎是由它使用的java.util.logging SUN邮件框架造成的。

com.sun.mail.imap 包关闭日志级别设置为。我不熟悉的java.util.logging非常好;你可以找到更多信息<一个href=\"http://stackoverflow.com/questions/6307648/change-global-setting-for-logger-instances\">here.

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

解决方案

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.

这篇关于Apache的骆驼日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆