1
我是log4j中的新成员。当我在互联网上阅读时,儿童记录器会继承父记录器设置。通常给出的例子是在同一个包中的两个类。但是如果这些课程将采用不同的包装呢?例如不同软件包之间的log4j层次结构
import com.foo.Bar;
public class MyApp{
static Logger logger = Logger.getLogger(MyApp.class);
public static void main(String[] args) {
BasicConfigurator.configure(); // default logging level is debug
Bar bar = new Bar();
bar.doIt();
}
}
,并在不同的包第二类
package mypackage;
import org.apache.log4j.Logger;
public class Bar {
static Logger logger = Logger.getLogger(Bar.class);
public void doIt() {
logger.debug("Did it again!");
}
}
那么什么会记录在Bar
一流的水平?