Search in sources :

Example 1 with DefaultLogger

use of liquibase.logging.core.DefaultLogger in project liquibase by liquibase.

the class LogFactory method getLog.

public Logger getLog(String name) {
    if (!loggers.containsKey(name)) {
        Logger value;
        try {
            ServiceLocator serviceLocator = ServiceLocator.getInstance();
            if (serviceLocator == null) {
                //ServiceLocator not yet running
                return defaultLogger;
            }
            value = (Logger) serviceLocator.newInstance(Logger.class);
        } catch (Exception e) {
            return defaultLogger;
        }
        value.setName(name);
        if (defaultLoggingLevel != null) {
            value.setLogLevel(defaultLoggingLevel);
        }
        loggers.put(name, value);
    }
    return loggers.get(name);
}
Also used : ServiceLocator(liquibase.servicelocator.ServiceLocator) DefaultLogger(liquibase.logging.core.DefaultLogger) ServiceNotFoundException(liquibase.exception.ServiceNotFoundException)

Aggregations

ServiceNotFoundException (liquibase.exception.ServiceNotFoundException)1 DefaultLogger (liquibase.logging.core.DefaultLogger)1 ServiceLocator (liquibase.servicelocator.ServiceLocator)1