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

Closes #58: Use Spring Boot properties for log configuration #59

Merged
merged 2 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
7 changes: 6 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ server.port=8081
spring.application.name=userservice
spring.config.import=optional:configserver:${CONFIG_SERVER}
spring.jpa.open-in-view=false
spring.flyway.baseline-on-migrate = true
spring.flyway.baseline-on-migrate = true
#logging.file.path= write logs to the current directory
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
Loading