static

in src/main/java/org/apache/commons/logging/LogSource.java [80:121]


    static {

        // Is Log4J Available?
        log4jIsAvailable = isClassForName("org.apache.log4j.Logger");

        // Set the default Log implementation
        String name = null;
        try {
            name = System.getProperty("org.apache.commons.logging.log");
            if (name == null) {
                name = System.getProperty("org.apache.commons.logging.Log");
            }
        } catch (final Throwable ignore) {
            // Ignore
        }
        if (name != null) {
            try {
                setLogImplementation(name);
            } catch (final Throwable t) {
                try {
                    setLogImplementation("org.apache.commons.logging.impl.NoOpLog");
                } catch (final Throwable ignore) {
                    // Ignore
                }
            }
        } else {
            try {
                if (log4jIsAvailable) {
                    setLogImplementation("org.apache.commons.logging.impl.Log4JLogger");
                } else {
                    setLogImplementation("org.apache.commons.logging.impl.Jdk14Logger");
                }
            } catch (final Throwable t) {
                try {
                    setLogImplementation("org.apache.commons.logging.impl.NoOpLog");
                } catch (final Throwable ignore) {
                    // Ignore
                }
            }
        }

    }