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