Skip to content

Commit 6be323f

Browse files
refactoring
1 parent 66b9cf1 commit 6be323f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

dbAndCsvBatch/src/main/java/com/example/batch/DbAndCsvBatchApp.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,11 @@ public static void main(String[] args) {
1919
/** Log startup arguments */
2020
private static void logBatchStartupDetails() {
2121
String commandProp = System.getProperty("sun.java.command");
22-
log.info(
23-
"##### KEY:\"sun.java.command\", VALUE:\"{}\"", System.getProperty("sun.java.command"));
24-
String jobName = StringUtils.substringAfterLast(commandProp, "--spring.batch.job.name=");
25-
jobName = StringUtils.substringBefore(jobName, " ");
26-
String profile = StringUtils.substringAfterLast(commandProp, "--spring.profiles.active=");
27-
profile = StringUtils.substringBefore(profile, " ");
22+
log.info("##### KEY:\"sun.java.command\", VALUE:\"{}\"", commandProp);
23+
String jobName = StringUtils.substringBetween(commandProp,
24+
"--spring.batch.job.name=", " ");
25+
String profile = StringUtils.substringAfter(commandProp,
26+
"--spring.profiles.active=");
2827
log.info("##### Spring Batch ##### - Job: {}, Profile: {}", jobName, profile);
2928
}
3029
}

0 commit comments

Comments
 (0)