while ( iterator.hasNext() ) { MetricsSnapshotInterface snapshot = iterator.next(); db.writeLogRecord( metricsLogTable, LogStatus.START, new LoggingMetric( batchId, snapshot ), null ); while ( iterator.hasNext() ) { MetricsSnapshotInterface snapshot = iterator.next(); db.writeLogRecord( metricsLogTable, LogStatus.START, new LoggingMetric( batchId, snapshot ), null );
/** * Writes step information to a step logging table (if one has been configured). * * @throws KettleException if any errors occur during logging */ protected void writeStepLogInformation() throws KettleException { Database db = null; StepLogTable stepLogTable = getTransMeta().getStepLogTable(); try { db = createDataBase( stepLogTable.getDatabaseMeta() ); db.shareVariablesWith( this ); db.connect(); db.setCommit( logCommitSize ); for ( StepMetaDataCombi combi : getSteps() ) { db.writeLogRecord( stepLogTable, LogStatus.START, combi, null ); } db.cleanupLogRecords( stepLogTable ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "Trans.Exception.UnableToWriteStepInformationToLogTable" ), e ); } finally { disconnectDb( db ); } }
/** * Writes information to Job Log table. Cleans old records, in case job is finished. */ protected void writeLogTableInformation( JobLogTable jobLogTable, LogStatus status ) throws KettleJobException, KettleDatabaseException { boolean cleanLogRecords = status.equals( LogStatus.END ); String tableName = jobLogTable.getActualTableName(); DatabaseMeta logcon = jobLogTable.getDatabaseMeta(); Database ldb = createDataBase( logcon ); ldb.shareVariablesWith( this ); try { ldb.connect(); ldb.setCommit( logCommitSize ); ldb.writeLogRecord( jobLogTable, status, this, null ); if ( cleanLogRecords ) { ldb.cleanupLogRecords( jobLogTable ); } } catch ( KettleDatabaseException dbe ) { addErrors( 1 ); throw new KettleJobException( "Unable to end processing by writing log record to table " + tableName, dbe ); } finally { if ( !ldb.isAutoCommit() ) { ldb.commitLog( true, jobLogTable ); } ldb.disconnect(); } }
if ( transLogTableDatabaseConnection != null && !Utils.isEmpty( logTable ) && !Utils.isEmpty( transMeta .getName() ) ) { transLogTableDatabaseConnection.writeLogRecord( transLogTable, LogStatus.START, this, null );
/** * Write job entry log information. * * @throws KettleException * the kettle exception */ protected void writeJobEntryLogInformation() throws KettleException { Database db = null; JobEntryLogTable jobEntryLogTable = getJobMeta().getJobEntryLogTable(); try { db = createDataBase( jobEntryLogTable.getDatabaseMeta() ); db.shareVariablesWith( this ); db.connect(); db.setCommit( logCommitSize ); for ( JobEntryCopy copy : getJobMeta().getJobCopies() ) { db.writeLogRecord( jobEntryLogTable, LogStatus.START, copy, this ); } db.cleanupLogRecords( jobEntryLogTable ); } catch ( Exception e ) { throw new KettleException( BaseMessages.getString( PKG, "Job.Exception.UnableToJobEntryInformationToLogTable" ), e ); } finally { if ( !db.isAutoCommit() ) { db.commitLog( true, jobEntryLogTable ); } db.disconnect(); } }
db.writeLogRecord( channelLogTable, LogStatus.START, loggingHierarchy, null );
ldb.writeLogRecord( transLogTable, status, this, null );
db.writeLogRecord( channelLogTable, LogStatus.START, loggingHierarchy, null );
ldb.writeLogRecord( jobMeta.getJobLogTable(), LogStatus.START, this, null ); if ( !ldb.isAutoCommit() ) { ldb.commitLog( true, jobMeta.getJobLogTable() );