为什么不是已经习惯我的log4j.properties文件? [英] Why isn't my log4j.properties file getting used?

查看:131
本文介绍了为什么不是已经习惯我的log4j.properties文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的当前目录中的log4j.properties文件,指定一些事情记录在DEBUG级别,以及其他一切的信息:

I have a log4j.properties file in my current directory that specifies some things to log at DEBUG level, and everything else as INFO:

log4j.rootLogger=WARN, stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=[%5p] %d{mm:ss} (%F:%M:%L)%n%m%n%n

log4j.logger.com.xcski=DEBUG
log4j.logger.org.apache.nutch.protocol.http=DEBUG
log4j.logger.org.apache.nutch.fetcher.Fetcher=DEBUG

和我从蚂蚁运行该项目:

And I run the project from ant:

<target name="crawl" depends="compile">
  <java classname="com.xcski.nutch.crawler.Crawler"
        maxmemory="1000m" fork="true">
      <classpath refid="run.classpath"/>
  </java>
</target>

但由于某些原因,我得到的唯一输出来自LOG.info(),而不是LOG.debug。我敢肯定这件事情微不足道,但我一直在打我的头撞在墙上了一个小时,我想我会尝试左右。

But for some reason, the only output I get is from LOG.info(), not LOG.debug. I'm sure it's something trivial, but I've been beating my head against the wall for an hour now and I thought I'd try SO.

推荐答案

当前目录是不包含在类路径中的默认。你明确地添加它?

Current directory is not by default included in classpath. Did you add it explicitly?

这篇关于为什么不是已经习惯我的log4j.properties文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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