Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add logging configuration to application properties files #139

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Set customizable log pattern through configuration
Both the auth and open have overrides so they be easily distinguished in the aggregated logs.
Gcolon021 committed Mar 20, 2025
commit 28df3052040bcaddebb9248416d68030b3e7af42
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"properties": [
{
"name": "log.pattern",
"type": "java.lang.String",
"description": "Description for log.pattern."
}
] }
Original file line number Diff line number Diff line change
@@ -10,4 +10,4 @@ data-export.s3.region=us-east-1
data-export.s3.signedUrl-expiry-minutes=60

dictionary.host = http://wildfly.___TARGET_STACK___:8080/

log.pattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [auth-hpds] [%thread] %logger{36} : %msg%n
Original file line number Diff line number Diff line change
@@ -9,4 +9,5 @@ data-export.s3.bucket-name=pic-sure-auth-prod-data-export
data-export.s3.region=us-east-1
data-export.s3.signedUrl-expiry-minutes=60

dictionary.host = http://wildfly.___TARGET_STACK___:8080/
dictionary.host = http://wildfly.___TARGET_STACK___:8080/
log.pattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [auth-hpds] [%thread] %logger{36} : %msg%n
3 changes: 2 additions & 1 deletion service/src/main/resources/application-open.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
SMALL_JOB_LIMIT = 100
SMALL_TASK_THREADS = 1
LARGE_TASK_THREADS = 1
LARGE_TASK_THREADS = 1
log.pattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [open-hpds] [%thread] %logger{36} : %msg%n
3 changes: 2 additions & 1 deletion service/src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -5,4 +5,5 @@ LARGE_TASK_THREADS = 1
# Logging File Output https://docs.spring.io/spring-boot/reference/features/logging.html#features.logging.file-output
# If you are adding additional log files please add them to /var/log/ directory.
logging.file.name=/var/log/hpds.log
logging.level.root=info
logging.level.root=info
log.pattern=%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [hpds] [%thread] %logger{36} : %msg%n
4 changes: 2 additions & 2 deletions service/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<configuration>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${LOG_PATTERN:-%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [hpds] [%thread] %logger{36} : %msg%n}</pattern>
<pattern>${log.pattern:-%d{yyyy-MM-dd'T'HH:mm:ss.SSS'Z', UTC} %-5level --- [hpds] [%thread] %logger{36} : %msg%n}</pattern>
</encoder>
</appender>

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