diff --git a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java index 8dc61a88a..08dd2f993 100644 --- a/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java +++ b/spring-batch-core/src/main/java/org/springframework/batch/core/step/AbstractStep.java @@ -15,6 +15,7 @@ */ package org.springframework.batch.core.step; +import java.time.Duration; import java.util.Date; import io.micrometer.core.instrument.Tag; @@ -267,6 +268,8 @@ public abstract class AbstractStep implements Step, InitializingBean, BeanNameAw )); stepExecution.setEndTime(new Date()); stepExecution.setExitStatus(exitStatus); + Duration stepExecutionDuration = BatchMetrics.calculateDuration(stepExecution.getStartTime(), stepExecution.getEndTime()); + logger.info("Step: [" + stepExecution.getStepName() + "] executed in " + BatchMetrics.formatDuration(stepExecutionDuration)); try { getJobRepository().update(stepExecution);