1 16 17 package examples.subclass; 18 19 import org.apache.log4j.*; 20 import org.apache.log4j.spi.LoggerFactory; 21 import org.apache.log4j.xml.DOMConfigurator; 22 import examples.customLevel.XLevel; 23 import org.apache.log4j.PropertyConfigurator; 24 import org.apache.log4j.helpers.LogLog; 25 26 35 public class MyLogger extends Logger { 36 37 static String FQCN = MyLogger.class.getName() + "."; 42 43 private static MyLoggerFactory myFactory = new MyLoggerFactory(); 45 46 49 public MyLogger(String name) { 50 super(name); 51 } 52 53 56 public 57 void debug(Object message) { 58 super.log(FQCN, Level.DEBUG, message + " world.", null); 59 } 60 61 65 public 66 static 67 Logger getLogger(String name) { 68 return Logger.getLogger(name, myFactory); 69 } 70 71 public 72 void trace(Object message) { 73 super.log(FQCN, XLevel.TRACE, message, null); 74 } 75 } 76 77 78 | Popular Tags |