Skip to content

Commit

Permalink
Closes #58: Use Spring Boot properties for log configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
aprajshekhar committed Mar 9, 2024
1 parent da82e19 commit 3e3ee4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions gamedoora-user-services.service
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ After=syslog.target gamedoora-config-server.service
User=gamedoora
ExecStart=/opt/gamedoora/gamedoora-user-services.jar
SuccessExitStatus=143
Environment="CONFIG_SERVER=http://localhost:8888"
Environment="CONFIG_SERVER=http://localhost:8888 LOG_PATH=/var/log/gamedoora/user_service_logs"

# Redirect standard output and standard error to the main log file.
StandardOutput=file:/var/log/gamedoora/user_service_logs/user_services.log
StandardError=file:/var/log/gamedoora/user_service_logs/user_services.log
# StandardOutput=file:/var/log/gamedoora/user_service_logs/user_services.log
# StandardError=file:/var/log/gamedoora/user_service_logs/user_services.log

# Rotate log based on days, capacity, file size, compress, etc.
# LogsDirectory=/gamedoora/user_service_logs
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ spring.config.import=optional:configserver:${CONFIG_SERVER}
spring.jpa.open-in-view=false
spring.flyway.baseline-on-migrate = true
#logging.file.path= write logs to the current directory
logging.file.name=${LOG_PATH}/myapp.log
logging.file.name=${LOG_PATH}/userservice.log
logging.pattern.file= %d{yyyy-MMM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{15} - %msg%n
logging.pattern.console= %d{yyyy-MMM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{15} - %msg%n
logging.level.com.gamedoora=DEBUG

0 comments on commit 3e3ee4e

Please sign in to comment.