in src/main/java/org/apache/commons/logging/LogFactory.java [951:978]
protected static LogFactory newFactory(final String factoryClass,
final ClassLoader classLoader,
final ClassLoader contextClassLoader)
throws LogConfigurationException {
// Note that any unchecked exceptions thrown by the createFactory
// method will propagate out of this method; in particular a
// ClassCastException can be thrown.
final Object result = AccessController.doPrivileged(
new PrivilegedAction() {
@Override
public Object run() {
return createFactory(factoryClass, classLoader);
}
});
if (result instanceof LogConfigurationException) {
final LogConfigurationException ex = (LogConfigurationException) result;
if (isDiagnosticsEnabled()) {
logDiagnostic("An error occurred while loading the factory class:" + ex.getMessage());
}
throw ex;
}
if (isDiagnosticsEnabled()) {
logDiagnostic("Created object " + objectId(result) + " to manage classloader " +
objectId(contextClassLoader));
}
return (LogFactory)result;
}