01: /*
02: This software is OSI Certified Open Source Software.
03: OSI Certified is a certification mark of the Open Source Initiative.
04:
05: The license (Mozilla version 1.0) can be read at the MMBase site.
06: See http://www.MMBase.org/license
07:
08: */
09:
10: package org.mmbase.util.logging.log4j;
11:
12: import org.apache.log4j.Logger;
13: import org.apache.log4j.spi.LoggerFactory;
14:
15: /**
16: * @author Michiel Meeuwissen
17: */
18:
19: public final class LoggerRepository extends org.apache.log4j.Hierarchy
20: implements org.apache.log4j.spi.LoggerRepository {
21: private LoggerFactory defaultFactory;
22:
23: public LoggerRepository(Logger root) {
24: super (root);
25: defaultFactory = new MMCategoryFactory();
26: }
27:
28: public Logger getLogger(String name) {
29: return getLogger(name, defaultFactory);
30: }
31:
32: }
33:
34: class MMCategoryFactory implements LoggerFactory {
35:
36: MMCategoryFactory() {
37: }
38:
39: public Logger makeNewLoggerInstance(String name) {
40: return new Log4jImpl(name);
41: }
42: }
|