Skip to content

Commit

Permalink
Merge pull request #90 from moidot/chore/enhance-with-cache
Browse files Browse the repository at this point in the history
chore: 로그를 위해 운영 프로필 분리
  • Loading branch information
yujung7768903 authored Nov 1, 2023
2 parents 872d5d1 + e0e28c1 commit d931954
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:

- uses : actions/checkout@v3
- run : touch ./src/main/resources/application.yml
- run : touch ./src/main/resources/application-prod.yml
- run : echo "${{ secrets.APPLICATION }}" > ./src/main/resources/application.yml
- run : cat ./src/main/resources/application.yml

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ gradle-app.setting
# End of https://www.toptal.com/developers/gitignore/api/intellij+all,macos,netbeans,java,gradle,maven
src/main/resources/application.yml
src/main/resources/application-dev.yml
src/main/resources/application-prod.yml

src/test/resources/application.yml

Expand Down
2 changes: 1 addition & 1 deletion scripts/run_new_was.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ if [ ! -z ${TARGET_PID} ]; then
sudo kill ${TARGET_PID}
fi

nohup java -jar -Dserver.port=${TARGET_PORT} ${JAR_FILE} > /home/ec2-user/nohup.out 2>&1 &
nohup java -jar -Dspring.profiles.active=prod -Dserver.port=${TARGET_PORT} ${JAR_FILE} > /home/ec2-user/nohup.out 2>&1 &
echo "> Now new WAS runs at ${TARGET_PORT}."
exit 0
11 changes: 10 additions & 1 deletion src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@
<configuration>
<property name="CONSOLE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %highlight(%-5level) %cyan(%logger) - %msg%n"/>
<property name="FILE_LOG_PATTERN" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger - %msg%n"/>
<property name="LOG_PATH" value="../logs"/>
<springProfile name="local">
<property resource="application.yml" />
</springProfile>
<springProfile name="dev">
<property resource="application-dev.yml" />
</springProfile>
<springProfile name="prod">
<property resource="application-prod.yml" />
</springProfile>
<springProperty name="LOG_PATH" source="log.config.path"/>
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>${CONSOLE_LOG_PATTERN}</pattern>
Expand Down

0 comments on commit d931954

Please sign in to comment.