Skip to content

Commit

Permalink
fix log4j log format (#697)
Browse files Browse the repository at this point in the history
  • Loading branch information
msbarry authored Oct 26, 2023
1 parent a0cd4fa commit 2bb05a0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private LogUtil() {}

/** Prepends {@code [stage]} to all subsequent logs from this thread. */
public static void setStage(String stage) {
MDC.put(STAGE_KEY, stage);
MDC.put(STAGE_KEY, "[%s] ".formatted(stage));
}

/** Removes {@code [stage]} from subsequent logs from this thread. */
Expand Down
2 changes: 1 addition & 1 deletion planetiler-core/src/main/resources/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ appenders=console
appender.console.type=Console
appender.console.name=STDOUT
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=%highlight{$${uptime:now} %level{length=3} %notEmpty{[%X{stage}] }- %msg%n%throwable}{FATAL=red, ERROR=red, WARN=YELLOW, INFO=normal, DEBUG=normal, TRACE=normal}
appender.console.layout.pattern=%highlight{$${uptime:now} %level{length=3} %X{stage}- %msg%n%throwable}{FATAL=red, ERROR=red, WARN=YELLOW, INFO=normal, DEBUG=normal, TRACE=normal}
packages=com.onthegomap.planetiler.util.log4j
rootLogger.level=debug
rootLogger.appenderRefs=stdout
Expand Down
2 changes: 1 addition & 1 deletion planetiler-core/src/test/resources/log4j2-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ appenders=console
appender.console.type=Console
appender.console.name=STDOUT
appender.console.layout.type=PatternLayout
appender.console.layout.pattern=$${uptime:now} %level{length=3} %notEmpty{[%X{stage}] }- %msg%n%throwable
appender.console.layout.pattern=$${uptime:now} %level{length=3} %X{stage}- %msg%n%throwable
packages=com.onthegomap.planetiler.util.log4j
rootLogger.level=warn
rootLogger.appenderRefs=stdout
Expand Down

0 comments on commit 2bb05a0

Please sign in to comment.