use of org.apache.hop.reflection.pipeline.transform.PipelineLogging in project hop by apache.
the class PipelineStartLoggingXp method executeLoggingPipeline.
private synchronized void executeLoggingPipeline(PipelineLog pipelineLog, String loggingPhase, String loggingPipelineFilename, IPipelineEngine<PipelineMeta> pipeline, IVariables variables) throws HopException {
PipelineMeta loggingPipelineMeta = new PipelineMeta(loggingPipelineFilename, pipeline.getMetadataProvider(), true, variables);
// Create a local pipeline engine...
//
LocalPipelineEngine loggingPipeline = new LocalPipelineEngine(loggingPipelineMeta, variables, pipeline);
// Flag it as a logging pipeline so we don't log ourselves...
//
loggingPipeline.getExtensionDataMap().put(PIPELINE_LOGGING_FLAG, "Y");
// Only log errors
loggingPipeline.setLogLevel(LogLevel.ERROR);
loggingPipeline.prepareExecution();
//
for (TransformMetaDataCombi combi : loggingPipeline.getTransforms()) {
if (combi.transform instanceof PipelineLogging) {
PipelineLogging pipelineLogging = (PipelineLogging) combi.transform;
pipelineLogging.setLoggingPipeline(pipeline);
pipelineLogging.setLoggingPhase(loggingPhase);
}
}
// Execute the logging pipeline to save the logging information
//
loggingPipeline.startThreads();
loggingPipeline.waitUntilFinished();
}
Aggregations