protected static LogFactory newFactory()

in src/main/java/org/apache/commons/logging/LogFactory.java [1386:1401]


    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((PrivilegedAction<?>) () -> createFactory(factoryClass, classLoader));
        if (result instanceof LogConfigurationException) {
            final LogConfigurationException ex = (LogConfigurationException) result;
            logDiagnostic(() -> "An error occurred while loading the factory class:" + ex.getMessage());
            throw ex;
        }
        logDiagnostic(() -> "Created object " + objectId(result) + " to manage class loader " + objectId(contextClassLoader));
        return (LogFactory) result;
    }