static

in src/main/java/org/apache/commons/logging/LogFactory.java [234:259]


    static {
        // note: it's safe to call methods before initDiagnostics (though
        // diagnostic output gets discarded).
        final ClassLoader thisClassLoader = getClassLoader(LogFactory.class);
        thisClassLoaderRef = new WeakReference<>(thisClassLoader);
        // In order to avoid confusion where multiple instances of JCL are
        // being used via different class loaders within the same app, we
        // ensure each logged message has a prefix of form
        // [LogFactory from class loader OID]
        //
        // Note that this prefix should be kept consistent with that
        // in LogFactoryImpl. However here we don't need to output info
        // about the actual *instance* of LogFactory, as all methods that
        // output diagnostics from this class are static.
        String classLoaderName;
        try {
            classLoaderName = thisClassLoader != null ? objectId(thisClassLoader) : "BOOTLOADER";
        } catch (final SecurityException e) {
            classLoaderName = "UNKNOWN";
        }
        DIAGNOSTICS_PREFIX = "[LogFactory from " + classLoaderName + "] ";
        DIAGNOSTICS_STREAM = initDiagnostics();
        logClassLoaderEnvironment(LogFactory.class);
        factories = createFactoryStore();
        logDiagnostic("BOOTSTRAP COMPLETED");
    }