From 60ca112b36086959210728921fd03b7a4482ada4 Mon Sep 17 00:00:00 2001 From: KIM MIN WOO <79193811+minwoo1999@users.noreply.github.com> Date: Mon, 30 Dec 2024 16:35:53 +0900 Subject: [PATCH] Refactor: Remove redundant logger name usage in SimpleFormatter --- .../springframework/boot/logging/java/SimpleFormatter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java index fc9dbfbcaf29..49a60b5df94e 100644 --- a/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java +++ b/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/java/SimpleFormatter.java @@ -32,7 +32,7 @@ */ public class SimpleFormatter extends Formatter { - private static final String DEFAULT_FORMAT = "[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL] - %8$s %4$s [%7$s] --- %3$s: %5$s%6$s%n"; + private static final String DEFAULT_FORMAT = "[%1$tY-%1$tm-%1$td %1$tH:%1$tM:%1$tS.%1$tL] - %2$s %4$s [%7$s] --- %2$s: %5$s%6$s%n"; private final String format = getOrUseDefault("LOG_FORMAT", DEFAULT_FORMAT); @@ -45,7 +45,7 @@ public String format(LogRecord record) { String message = formatMessage(record); String throwable = getThrowable(record); String thread = getThreadName(); - return String.format(this.format, date, source, record.getLoggerName(), record.getLevel().getLocalizedName(), + return String.format(this.format, date, source, record.getLevel().getLocalizedName(), message, throwable, thread, this.pid); }