public StringBuffer getBuffer( String parentLogChannelId, boolean includeGeneral, int startLineNr, int endLineNr ) { StringBuilder eventBuffer = new StringBuilder( 10000 ); List<KettleLoggingEvent> events = getLogBufferFromTo( parentLogChannelId, includeGeneral, startLineNr, endLineNr ); for ( KettleLoggingEvent event : events ) { eventBuffer.append( layout.format( event ) ).append( Const.CR ); } return new StringBuffer( eventBuffer ); }
/** * 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 ); }
/** * @param parentLogChannelId the parent log channel ID to grab * @param includeGeneral include general log lines * @param from * @param to * @return */ public List<KettleLoggingEvent> getLogBufferFromTo( String parentLogChannelId, boolean includeGeneral, int from, int to ) { // Typically, the log channel id is the one from the transformation or job running currently. // However, we also want to see the details of the steps etc. // So we need to look at the parents all the way up if needed... // List<String> childIds = loggingRegistry.getLogChannelChildren( parentLogChannelId ); return getLogBufferFromTo( childIds, includeGeneral, from, to ); }
sql.setLoggingText( KettleLogStore.getAppender().getLogBufferFromTo( db.getLogChannelId(), true, startLogLine, endLogLine ).toString() ); sql.setComplete( true );