我有一个类似的用例,我创建了一个 StepListener 并打印所有有用的信息。这是示例:
public class StepExecuteListener extends StepExecutionListenerSupport {
private static final Logger LOG = LoggerFactory.getLogger(StepExecuteListener.class);
@Override
public void beforeStep(StepExecution stepExecution) {
// No action needed
}
@Override
public ExitStatus afterStep(StepExecution stepExecution) {
LOG.debug("StepExecutionListener - afterStep:getCommitCount= {}", stepExecution.getCommitCount());
LOG.debug("StepExecutionListener - afterStep:getFilterCount= {}", stepExecution.getFilterCount());
LOG.debug("StepExecutionListener - afterStep:getProcessSkipCount= {}", stepExecution.getProcessSkipCount());
LOG.info("StepExecutionListener - afterStep:getReadCount= {}", stepExecution.getReadCount());
LOG.debug("StepExecutionListener - afterStep:getReadSkipCount= {}", stepExecution.getReadSkipCount());
LOG.debug("StepExecutionListener - afterStep:getRollbackCount= {}", stepExecution.getRollbackCount());
LOG.info("StepExecutionListener - afterStep:getWriteCount= {}", stepExecution.getWriteCount());
LOG.debug("StepExecutionListener - afterStep:getWriteSkipCount= {}", stepExecution.getWriteSkipCount());
LOG.debug("StepExecutionListener - afterStep:getStepName= {}", stepExecution.getStepName());
LOG.debug("StepExecutionListener - afterStep:getSummary= {}", stepExecution.getSummary());
LOG.debug("StepExecutionListener - afterStep:getStartTime= {}", stepExecution.getStartTime());
LOG.debug("StepExecutionListener - afterStep:getStartTime= {}", stepExecution.getEndTime());
LOG.debug("StepExecutionListener - afterStep:getLastUpdated= {}", stepExecution.getLastUpdated());
LOG.debug("StepExecutionListener - afterStep:getExitStatus= {}", stepExecution.getExitStatus());
LOG.debug("StepExecutionListener - afterStep:getFailureExceptions= {}", stepExecution.getFailureExceptions());
return null;
}
}