Skip to content

Commit

Permalink
[MOA-482] 개발서버에서는 로그파일 따로 관리하지 않도록 변경 (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
shin-mallang committed Feb 29, 2024
1 parent 2778f29 commit 95ad854
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
1 change: 0 additions & 1 deletion .github/workflows/dev-api-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,5 @@ jobs:
--name ${{ env.DOCKER_CONTAINER_NAME }} \
--network ${{ env.DOCKER_CONTAINER_NETWORK }} \
-p 8080:8080 \
-v ./logs:/logs \
-e "SPRING_PROFILES_ACTIVE=${{ env.PROFILE }}" \
${{ env.DOCKER_HUB_REPOSITORY }}:${{ env.IMAGE_TAG }}
1 change: 0 additions & 1 deletion .github/workflows/dev-batch-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,5 @@ jobs:
-d \
--name ${{ env.DOCKER_CONTAINER_NAME }} \
-p 18080:8080 \
-v ./logs:/logs \
-e "SPRING_PROFILES_ACTIVE=${{ env.PROFILE }}" \
${{ env.DOCKER_HUB_REPOSITORY }}:${{ env.IMAGE_TAG }}
3 changes: 2 additions & 1 deletion .github/workflows/prod-api-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,12 @@ jobs:
- name: ✨ Docker Image 실행
run: |
pwd
docker run \
-d \
--name ${{ env.DOCKER_CONTAINER_NAME }} \
--network ${{ env.DOCKER_CONTAINER_NETWORK }} \
-p 8080:8080 \
-v ./logs:/logs \
-v ~/logs:/logs \
-e "SPRING_PROFILES_ACTIVE=${{ env.PROFILE }}" \
${{ env.DOCKER_HUB_REPOSITORY }}:${{ env.IMAGE_TAG }}
2 changes: 1 addition & 1 deletion .github/workflows/prod-batch-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,6 @@ jobs:
-d \
--name ${{ env.DOCKER_CONTAINER_NAME }} \
-p 18080:8080 \
-v ./logs:/logs \
-v ~/logs:/logs \
-e "SPRING_PROFILES_ACTIVE=${{ env.PROFILE }}" \
${{ env.DOCKER_HUB_REPOSITORY }}:${{ env.IMAGE_TAG }}
8 changes: 4 additions & 4 deletions api/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<property name="consoleLogPattern"
value="[%d{yyyy-MM-dd' T 'HH:mm:ss.SSS}] %clr(%-5level) %clr(${PID:-}){magenta} %clr(---){faint} %clr([%15.15thread]){faint} %clr(%-40.40logger{36}){cyan} %clr(:){faint} : [%X{requestId}] %msg%n"/>

<springProfile name="local, default, test">
<springProfile name="local, default, test, dev">
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
Expand All @@ -18,9 +18,9 @@
</root>
</springProfile>

<springProfile name="dev, prod">
<property name="infoLogPath" value="logs/backend/info"/>
<property name="errorLogPath" value="logs/backend/error"/>
<springProfile name="prod">
<property name="infoLogPath" value="logs/info"/>
<property name="errorLogPath" value="logs/error"/>
<property name="fileNamePattern" value="%d{yyyy-MM-dd}_%i.log"/>

<appender name="info-warn-error-appender" class="ch.qos.logback.core.rolling.RollingFileAppender">
Expand Down
4 changes: 2 additions & 2 deletions batch/src/main/resources/logback-spring.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<property name="consoleLogPattern"
value="[%d{yyyy-MM-dd' T 'HH:mm:ss.SSS}] %clr(%-5level) %clr(${PID:-}){magenta} %clr(---){faint} %clr([%15.15thread]){faint} %clr(%-40.40logger{36}){cyan} %clr(:){faint} : %msg%n"/>

<springProfile name="local, default, test">
<springProfile name="local, default, test, dev">
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter"/>

<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
Expand All @@ -18,7 +18,7 @@
</root>
</springProfile>

<springProfile name="dev, prod">
<springProfile name="prod">
<property name="infoLogPath" value="logs/backend/info"/>
<property name="errorLogPath" value="logs/backend/error"/>
<property name="fileNamePattern" value="%d{yyyy-MM-dd}_%i.log"/>
Expand Down

0 comments on commit 95ad854

Please sign in to comment.