/** * @return The appender that represents the central logging store. It is capable of giving back log rows in an * incremental fashion, etc. */ public static LoggingBuffer getAppender() { return getInstance().appender; }
/** * @return the number (sequence, 1..N) of the last log line. If no records are present in the buffer, 0 is returned. */ public static int getLastBufferLineNr() { return getInstance().appender.getLastBufferLineNr(); }
public void replaceLogCleaner( final int maxLogTimeoutMinutes ) { KettleLogStore.getInstance().replaceLogCleaner( maxLogTimeoutMinutes ); }
/** * Get all the log lines for the specified parent log channel id (including all children) * * @param channelId * channel IDs to grab * @param includeGeneral * include general log lines * @param from * @param to * @return */ public static List<KettleLoggingEvent> getLogBufferFromTo( List<String> channelId, boolean includeGeneral, int from, int to ) { return getInstance().appender.getLogBufferFromTo( channelId, includeGeneral, from, to ); }
/** * * Get all the log lines pertaining to the specified parent log channel id (including all children) * * @param parentLogChannelId * the parent log channel ID to grab * @param includeGeneral * include general log lines * @param from * @param to * @return the log lines found */ public static List<KettleLoggingEvent> getLogBufferFromTo( String parentLogChannelId, boolean includeGeneral, int from, int to ) { return getInstance().appender.getLogBufferFromTo( parentLogChannelId, includeGeneral, from, to ); }
public static void reset() { if ( KettleLogStore.isInitialized() ) { KettleLogStore.getInstance().reset(); } PluginRegistry.getInstance().reset(); initialized = null; } }
/** * Discard all the lines for the specified log channel id AND all the children. * * @param parentLogChannelId * the parent log channel id to be removed along with all its children. */ public static void discardLines( String parentLogChannelId, boolean includeGeneralMessages ) { LoggingRegistry registry = LoggingRegistry.getInstance(); MetricsRegistry metricsRegistry = MetricsRegistry.getInstance(); List<String> ids = registry.getLogChannelChildren( parentLogChannelId ); // Remove all the rows for these ids // LoggingBuffer bufferAppender = getInstance().appender; // int beforeSize = bufferAppender.size(); for ( String id : ids ) { // Remove it from the central log buffer // bufferAppender.removeChannelFromBuffer( id ); // Also remove the item from the registry. // registry.getMap().remove( id ); metricsRegistry.getSnapshotLists().remove( id ); metricsRegistry.getSnapshotMaps().remove( id ); } // Now discard the general lines if this is required // if ( includeGeneralMessages ) { bufferAppender.removeGeneralMessages(); } }
void cleanUp() { KettleClientEnvironment.reset(); PluginRegistry.getInstance().reset(); MetricsRegistry.getInstance().reset(); ExtensionPointMap.getInstance().reset(); if ( KettleLogStore.isInitialized() ) { KettleLogStore.getInstance().reset(); } KettleLogStore.setLogChannelInterfaceFactory( new LogChannelFactory() ); if ( Props.isInitialized() ) { Props.getInstance().reset(); } KettleVFS.getInstance().reset(); XMLHandlerCache.getInstance().clear(); ValueMetaFactory.pluginRegistry = PluginRegistry.getInstance(); // under no circumstance reset the LoggingRegistry // LoggingRegistry.getInstance().reset(); }