Home | History | Annotate | Download | only in logging

Lines Matching refs:LogFactory

56 public abstract class LogFactory {
76 * The name (<code>org.apache.commons.logging.LogFactory</code>) of the property
77 * used to identify the LogFactory implementation
82 "org.apache.commons.logging.LogFactory";
85 * The fully qualified class name of the fallback <code>LogFactory</code>
103 "META-INF/services/org.apache.commons.logging.LogFactory";
125 * generated by LogFactory or LogFactoryImpl. When non-null,
133 * LogFactory class is generating the output.
139 * (<code>org.apache.commons.logging.LogFactory.HashtableImpl</code>)
144 * <strong>Note:</strong> <code>LogFactory</code> will print:
146 * [ERROR] LogFactory: Load of custom hashtable failed</em>
152 * and <code>LogFactory</code> will attempt to load a new instance
159 * key="org.apache.commons.logging.LogFactory.HashtableImpl"
163 * will mean that <code>LogFactory</code> will load an instance of
174 "org.apache.commons.logging.LogFactory.HashtableImpl";
181 * same as LogFactory.class.getClassLoader(). However computing this
194 protected LogFactory() {
235 * the <code>LogFactory</code> you are using, the <code>Log</code>
286 * The previously constructed <code>LogFactory</code> instances, keyed by
292 * Prevously constructed <code>LogFactory</code> instance as in the
305 protected static LogFactory nullClassLoaderFactory = null;
309 * (context-classloader -> logfactory-object). Version 1.2+ of Java
319 * that LogFactory.release(contextClassLoader) is called whenever a
339 logDiagnostic("[ERROR] LogFactory: Load of custom hashtable failed");
343 System.err.println("[ERROR] LogFactory: Load of custom hashtable failed");
357 * <p>Construct (if necessary) and return a <code>LogFactory</code>
361 * <li>The <code>org.apache.commons.logging.LogFactory</code> system
374 * <code>LogFactory</code> implementation class is utilized, all of the
376 * on the corresponding <code>LogFactory</code> instance.</p>
386 public static LogFactory getFactory() throws LogConfigurationException {
400 LogFactory factory = getCachedFactory(contextClassLoader);
407 "[LOOKUP] LogFactory implementation requested for the first time for context classloader "
415 // "attributes" on the LogFactory implementation class. One particular
416 // property may also control which LogFactory concrete subclass is
434 // LogFactory or Log classes, just use the class that loaded
445 // Determine which concrete LogFactory subclass to use.
450 + "] to define the LogFactory subclass to use...");
458 "[LOOKUP] Creating an instance of LogFactory class '" + factoryClass
480 // This is not consistent with the behaviour when a bad LogFactory class is
484 // the specified class wasn't castable to this LogFactory type.
506 + "] to define the LogFactory subclass to use...");
529 "[LOOKUP] Creating an instance of LogFactory class " + factoryClassName
545 // note: if the specified LogFactory class wasn't compatible with LogFactory
568 + "' to define the LogFactory subclass to use...");
574 "[LOOKUP] Properties file specifies LogFactory subclass '"
583 "[LOOKUP] Properties file has no entry specifying LogFactory subclass.");
590 + " LogFactory subclass from..");
601 "[LOOKUP] Loading the default LogFactory implementation '" + FACTORY_DEFAULT
602 + "' via the same classloader that loaded this LogFactory"
606 // Note: unlike the above code which can try to load custom LogFactory
607 // implementations via the TCCL, we don't try to load the default LogFactory
613 // by an old LogFactory class in the parent, but that isn't
685 * Release any internal references to previously created {@link LogFactory}
690 * @param classLoader ClassLoader for which to release the LogFactory
704 LogFactory factory = (LogFactory) factories.get(classLoader);
716 * Release any internal references to previously created {@link LogFactory}
731 LogFactory element = (LogFactory) elements.nextElement();
783 * Calls LogFactory.directGetContextClassLoader under the control of an
822 * this method is called every time LogFactory.getLogger() is called,
878 classLoader = getClassLoader(LogFactory.class);
881 // this message would be output for every call to LogFactory.getLog()
889 // + " the concrete LogFactory class.");
902 * with the current thread. This allows separate LogFactory objects
912 private static LogFactory getCachedFactory(ClassLoader contextClassLoader)
914 LogFactory factory = null;
923 factory = (LogFactory) factories.get(contextClassLoader);
930 * Remember this factory, so later calls to LogFactory.getCachedFactory
939 private static void cacheFactory(ClassLoader classLoader, LogFactory factory)
954 * Return a new instance of the specified <code>LogFactory</code>
957 * (abstract) LogFactory.
962 * concrete LogFactory subclass via a context classloader.
969 * LogFactory.getFactory (either directly or via LogFactory.getLog). Because
970 * class X was loaded via the parent, it binds to LogFactory loaded via
973 * LogFactory class defined in the child classloader, then LogFactoryYYYY
974 * will be bound to LogFactory@childloader. It cannot be cast to
975 * LogFactory@parentloader, ie this method cannot return the object as
976 * the desired type. Note that it doesn't matter if the LogFactory class
977 * in the child classloader is identical to the LogFactory class in the
982 * must ensure they remove all occurrences of the LogFactory class from
984 * do not have to move the custom LogFactory subclass; that is ok as
985 * long as the only LogFactory class it can find to bind to is in the
988 * @param factoryClass Fully qualified name of the <code>LogFactory</code>
998 protected static LogFactory newFactory(final String factoryClass,
1027 return (LogFactory)result;
1039 * LogFactory.getFactory, any custom definition in a subclass would be
1045 protected static LogFactory newFactory(final String factoryClass,
1060 * @return either a LogFactory object or a LogConfigurationException object.
1076 if (LogFactory.class.isAssignableFrom(logFactoryClass)) {
1098 + " does not extend '" + LogFactory.class.getName()
1104 return (LogFactory) logFactoryClass.newInstance();
1145 "The application has specified that a custom LogFactory implementation should be used but " +
1147 + LogFactory.class.getName() + "'. ";
1149 msg = msg + "The conflict is caused by the presence of multiple LogFactory classes in incompatible classloaders. " +
1151 "If you have not explicitly specified a custom LogFactory then it is likely that " +
1154 "specifying the standard LogFactory from the command line. ";
1171 // a shared classpath but the TCCL has a copy of LogFactory and the
1172 // specified LogFactory implementation; we will fall back to using the
1173 // LogFactory implementation from the same classloader as this class.
1175 // Issue: this doesn't handle the reverse case, where this LogFactory
1176 // is in the webapp, and the specified LogFactory implementation is
1178 // (a) the class really does implement LogFactory (bad log msg above)
1187 * to LogFactory.class.getClassLoader().load(name), ie we ignore
1194 * * LogFactory.class.getClassLoader() may return 'null'
1195 * if LogFactory is loaded by the bootstrap classloader.
1203 + " - trying the classloader associated with this LogFactory.");
1206 return (LogFactory) logFactoryClass.newInstance();
1210 logDiagnostic("Unable to create LogFactory instance.");
1213 && !LogFactory.class.isAssignableFrom(logFactoryClass)) {
1216 "The chosen LogFactory implementation does not extend LogFactory."
1225 * Determines whether the given class actually implements <code>LogFactory</code>.
1230 * the <code>LogFactory</code> class loaded by the class's classloader.
1231 * @param logFactoryClass <code>Class</code> which may implement <code>LogFactory</code>
1233 * <code>LogFactory</code> when that class is loaded via the same
1246 = Class.forName("org.apache.commons.logging.LogFactory", false, logFactoryClassLoader);
1250 + " implements LogFactory but was loaded by an incompatible classloader.");
1253 + " does not implement LogFactory.");
1277 // LogFactory cannot be loaded by the classloader which loaded the custom factory implementation.
1283 logDiagnostic("[CUSTOM LOG FACTORY] LogFactory class cannot be loaded by classloader which loaded the " +
1284 "custom LogFactory implementation. Is the custom factory in the right classloader?");
1528 // [LogFactory from classloader OID]
1532 // about the actual *instance* of LogFactory, as all methods that
1545 diagnosticPrefix = "[LogFactory from " + classLoaderName + "] ";
1566 * method puts in front of all its messages is LogFactory@....,
1721 // LogFactory instances are created, and they depend upon this
1737 thisClassLoader = getClassLoader(LogFactory.class);
1739 logClassLoaderEnvironment(LogFactory.class);