1 16 17 package org.apache.commons.logging; 18 19 import org.apache.commons.logging.impl.SLF4JLogFactory; 20 21 33 34 public abstract class LogFactory { 35 36 static LogFactory logFactory = new SLF4JLogFactory(); 37 38 44 public static final String FACTORY_PROPERTY = 45 "org.apache.commons.logging.LogFactory"; 46 47 53 public static final String FACTORY_DEFAULT = 54 "org.apache.commons.logging.impl.SLF4JLogFactory"; 55 56 61 public static final String FACTORY_PROPERTIES = 62 "commons-logging.properties"; 63 64 65 68 protected LogFactory() { 69 } 70 71 73 80 public abstract Object getAttribute(String name); 81 82 87 public abstract String [] getAttributeNames(); 88 89 99 public abstract Log getInstance(Class clazz) throws LogConfigurationException; 100 101 123 public abstract Log getInstance(String name) throws LogConfigurationException; 124 125 132 public abstract void release(); 133 134 141 public abstract void removeAttribute(String name); 142 143 154 public abstract void setAttribute(String name, Object value); 155 156 158 188 public static LogFactory getFactory() throws LogConfigurationException { 189 return logFactory; 190 } 191 192 202 public static Log getLog(Class clazz) throws LogConfigurationException { 203 204 return (getFactory().getInstance(clazz)); 205 } 206 207 219 public static Log getLog(String name) throws LogConfigurationException { 220 221 return (getFactory().getInstance(name)); 222 223 } 224 225 234 public static void release(ClassLoader classLoader) { 235 } 238 239 247 public static void releaseAll() { 248 } 251 252 } | Popular Tags |