由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - ant junit and log4j can't work together
相关主题
Java J2EE Contractor 求Refer Project怎么返回空指针呢?
Java/J2EE developer 求Refer Project超级菜鸟问题:什末时候load class
A question about inheritance想起几年前Re: run servlet from command line?
Re: Question: Java SynchronizationRe: 想起几年前Re: run servlet from command li
basic java question大家愿意讨论一下log4j么
Question about Tomcat多个Log4J配置文件问题
structure in Java??How to write a file to the same directory of the class file?
库里有一个函数名也叫Time如何动态改变log4j的log level啊
相关话题的讨论汇总
话题: log4j话题: junit话题: ant话题: together话题: problem
进入Java版参与讨论
1 (共1页)
f********h
发帖数: 149
1
I tried to use them altogether, but there is a problem.
If I invoke junit from ant, it complains the log4j system
is not properly set up. But if I run my code directly from console
using java myclass there is no problem.
Any solution to this?
e***g
发帖数: 158
2
log4j conf file should be in classpath?

【在 f********h 的大作中提到】
: I tried to use them altogether, but there is a problem.
: If I invoke junit from ant, it complains the log4j system
: is not properly set up. But if I run my code directly from console
: using java myclass there is no problem.
: Any solution to this?

f********h
发帖数: 149
3
I am not using the conf file now, just use BasicConfigurator.configure()

【在 e***g 的大作中提到】
: log4j conf file should be in classpath?
f********h
发帖数: 149
4
I found my mistake. I should have put all the initialization code of log4j
in the same static group. Now it's working.

【在 f********h 的大作中提到】
: I am not using the conf file now, just use BasicConfigurator.configure()
m******t
发帖数: 2416
5

What static group?

【在 f********h 的大作中提到】
: I found my mistake. I should have put all the initialization code of log4j
: in the same static group. Now it's working.

f********h
发帖数: 149
6
I mean something like
static {
your code goes here
}

【在 m******t 的大作中提到】
:
: What static group?

1 (共1页)
进入Java版参与讨论
相关主题
如何动态改变log4j的log level啊basic java question
Log4j expertQuestion about Tomcat
Can you show me ur Log4J config file?structure in Java??
一道面试题没回答好,学CS的看看 (转载)库里有一个函数名也叫Time
Java J2EE Contractor 求Refer Project怎么返回空指针呢?
Java/J2EE developer 求Refer Project超级菜鸟问题:什末时候load class
A question about inheritance想起几年前Re: run servlet from command line?
Re: Question: Java SynchronizationRe: 想起几年前Re: run servlet from command li
相关话题的讨论汇总
话题: log4j话题: junit话题: ant话题: together话题: problem