Search in sources :

Example 1 with ConsoleLoggingEventListener

use of org.pentaho.di.core.logging.ConsoleLoggingEventListener in project pentaho-kettle by pentaho.

the class KettleClientEnvironment method init.

public static synchronized void init(List<PluginTypeInterface> pluginsToLoad) throws KettleException {
    if (initialized != null) {
        return;
    }
    if (KettleClientEnvironment.instance == null) {
        KettleClientEnvironment.instance = new KettleClientEnvironment();
    }
    createKettleHome();
    // Read the kettle.properties file before anything else
    // 
    EnvUtil.environmentInit();
    // Initialize the logging back-end.
    // 
    KettleLogStore.init();
    // 
    if (!"Y".equalsIgnoreCase(System.getProperty(Const.KETTLE_DISABLE_CONSOLE_LOGGING, "N"))) {
        KettleLogStore.getAppender().addLoggingEventListener(new ConsoleLoggingEventListener());
    }
    KettleLogStore.getAppender().addLoggingEventListener(new Slf4jLoggingEventListener());
    // Load plugins
    // 
    pluginsToLoad.forEach(PluginRegistry::addPluginType);
    PluginRegistry.init();
    List<PluginInterface> logginPlugins = PluginRegistry.getInstance().getPlugins(LoggingPluginType.class);
    initLogginPlugins(logginPlugins);
    String passwordEncoderPluginID = Const.NVL(EnvUtil.getSystemProperty(Const.KETTLE_PASSWORD_ENCODER_PLUGIN), "Kettle");
    Encr.init(passwordEncoderPluginID);
    initialized = new Boolean(true);
}
Also used : Slf4jLoggingEventListener(org.pentaho.di.core.logging.Slf4jLoggingEventListener) PluginRegistry(org.pentaho.di.core.plugins.PluginRegistry) LoggingPluginInterface(org.pentaho.di.core.logging.LoggingPluginInterface) PluginInterface(org.pentaho.di.core.plugins.PluginInterface) ConsoleLoggingEventListener(org.pentaho.di.core.logging.ConsoleLoggingEventListener)

Aggregations

ConsoleLoggingEventListener (org.pentaho.di.core.logging.ConsoleLoggingEventListener)1 LoggingPluginInterface (org.pentaho.di.core.logging.LoggingPluginInterface)1 Slf4jLoggingEventListener (org.pentaho.di.core.logging.Slf4jLoggingEventListener)1 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)1 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)1