Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 8ec0d1e

Browse files
committedMar 20, 2025·
Update logback configuration to support customizable log pattern
Replaced hardcoded log patterns with a configurable LOG_PATTERN variable. This allows flexibility in formatting log entries and standardizes timestamps to ISO 8601 format with UTC time zone. Changes apply to both console and file appenders.
1 parent 9bc92aa commit 8ec0d1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎service/src/main/resources/logback.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<configuration>
22
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
33
<encoder>
4-
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{36} : %msg%n</pattern>
4+
<pattern>${LOG_PATTERN:-%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [hpds] [%thread] %logger{36} : %msg%n}</pattern>
55
</encoder>
66
</appender>
77

88
<appender name="FILE" class="ch.qos.logback.core.FileAppender">
99
<file>/var/log/hpds.log</file>
1010
<encoder>
11-
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{36} : %msg%n</pattern>
11+
<pattern>${LOG_PATTERN:-%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [hpds] [%thread] %logger{36} : %msg%n}</pattern>
1212
</encoder>
1313
</appender>
1414

0 commit comments

Comments
 (0)
Please sign in to comment.