/** * 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<LoggingEvent> getLogBufferFromTo( List<String> channelId, boolean includeGeneral, int from, int to ) { return convertKettleLoggingEventsToLog4jLoggingEvents( KettleLogStore.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<LoggingEvent> getLogBufferFromTo( String parentLogChannelId, boolean includeGeneral, int from, int to ) { List<KettleLoggingEvent> events = KettleLogStore.getLogBufferFromTo( parentLogChannelId, includeGeneral, from, to ); return convertKettleLoggingEventsToLog4jLoggingEvents( events ); }
@Override public void run() { for ( StepMetaDataCombi combi : trans.getSteps() ) { if ( combi.step.getErrors() > 0 ) { String channelId = combi.step.getLogChannel().getLogChannelId(); List<KettleLoggingEvent> eventList = KettleLogStore.getLogBufferFromTo( channelId, false, 0, KettleLogStore.getLastBufferLineNr() ); StringBuilder logText = new StringBuilder(); for ( KettleLoggingEvent event : eventList ) { Object message = event.getMessage(); if ( message instanceof LogMessage ) { LogMessage logMessage = (LogMessage) message; if ( logMessage.isError() ) { logText.append( logMessage.getMessage() ).append( Const.CR ); } } } stepLogMap.put( combi.stepMeta, logText.toString() ); } } } } );
setDebugStatus( "Errors detected for mapper transformation" ); List<KettleLoggingEvent> logList = KettleLogStore .getLogBufferFromTo( trans.getLogChannelId(), false, 0, KettleLogStore.getLastBufferLineNr() );