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?
|