Search in sources :

Example 1 with Slf4jLoggingEventListener

use of org.pentaho.di.core.logging.Slf4jLoggingEventListener 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)

Example 2 with Slf4jLoggingEventListener

use of org.pentaho.di.core.logging.Slf4jLoggingEventListener in project pdi-platform-plugin by pentaho.

the class PdiLifecycleListener method init.

public void init() throws PluginLifecycleException {
    try {
        KettleSystemListener.environmentInit(null);
        KettleLogStore.getAppender().addLoggingEventListener(new Slf4jLoggingEventListener());
    } catch (KettleException e) {
        throw new PluginLifecycleException(e);
    }
}
Also used : KettleException(org.pentaho.di.core.exception.KettleException) Slf4jLoggingEventListener(org.pentaho.di.core.logging.Slf4jLoggingEventListener) PluginLifecycleException(org.pentaho.platform.api.engine.PluginLifecycleException)

Aggregations

Slf4jLoggingEventListener (org.pentaho.di.core.logging.Slf4jLoggingEventListener)2 KettleException (org.pentaho.di.core.exception.KettleException)1 ConsoleLoggingEventListener (org.pentaho.di.core.logging.ConsoleLoggingEventListener)1 LoggingPluginInterface (org.pentaho.di.core.logging.LoggingPluginInterface)1 PluginInterface (org.pentaho.di.core.plugins.PluginInterface)1 PluginRegistry (org.pentaho.di.core.plugins.PluginRegistry)1 PluginLifecycleException (org.pentaho.platform.api.engine.PluginLifecycleException)1