From 77973b3ca90094f5cc7b773ec8ce1596762bfb3f Mon Sep 17 00:00:00 2001 From: can019 Date: Wed, 17 Sep 2025 17:27:37 +0900 Subject: [PATCH 1/2] =?UTF-8?q?hotfix:=20Loki=20appender=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-java.yml | 5 +-- .../src/main/resources/log4j2-production.yml | 34 ------------------- 2 files changed, 3 insertions(+), 36 deletions(-) diff --git a/.github/workflows/deploy-java.yml b/.github/workflows/deploy-java.yml index d7526506..4cf1ad38 100644 --- a/.github/workflows/deploy-java.yml +++ b/.github/workflows/deploy-java.yml @@ -44,6 +44,7 @@ jobs: key: ${{ secrets.SERVER_SSH_KEY }} source: "docker/production/docker-compose.yml" target: "~/app" + overwrite: true - name: Copy .env.prod file to EC2 uses: appleboy/scp-action@v0.1.7 @@ -62,7 +63,7 @@ jobs: username: ubuntu key: ${{ secrets.SERVER_SSH_KEY }} source: "docker/production/Caddyfile" - target: "~/app/docker/production/" + target: "~/app" overwrite: true - name: Copy promtail-config to EC2 @@ -72,7 +73,7 @@ jobs: username: ubuntu key: ${{ secrets.SERVER_SSH_KEY }} source: "docker/production/promtail-config.yml" - target: "~/app/docker/production/" + target: "~/app" overwrite: true diff --git a/apps/user-service/src/main/resources/log4j2-production.yml b/apps/user-service/src/main/resources/log4j2-production.yml index 2e88bd19..510df087 100644 --- a/apps/user-service/src/main/resources/log4j2-production.yml +++ b/apps/user-service/src/main/resources/log4j2-production.yml @@ -30,37 +30,6 @@ Configuration: PatternLayout: pattern: ${console-layout-pattern} - # Loki Appender - 프로덕션 모니터링용 - Loki: - name: loki-appender - url: ${LOKI_URL} # Grafana Cloud Loki URL - basicAuthUsername: ${LOKI_USERNAME} # Grafana Cloud 사용자 이름 - basicAuthPassword: ${LOKI_PASSWORD} # Grafana Cloud API Key - JsonLayout: - compact: true - eventEol: true - includeStacktrace: true - KeyValuePair: - - key: "app" - value: "${app-name}" - - key: "env" - value: "production" - Label: - - name: "app" - value: "${app-name}" - - name: "env" - value: "production" - - name: "traceId" - value: "${ctx:traceId}" - - name: "spanId" - value: "${ctx:spanId}" - - name: "executionType" - value: "${ctx:executionType:-application}" - - name: "sourceId" - value: "${ctx:sourceId}" - - name: "runId" - value: "${ctx:runId}" - JDBC: name: workflow-appender tableName: "execution_log" @@ -135,7 +104,6 @@ Configuration: level: INFO AppenderRef: - ref: console-appender - - ref: loki-appender - ref: file-prod-appender - ref: file-error-appender @@ -144,7 +112,6 @@ Configuration: additivity: "false" AppenderRef: - ref: workflow-appender - - ref: loki-appender - ref: console-appender - ref: file-prod-appender - ref: file-error-appender @@ -172,7 +139,6 @@ Configuration: AppenderRef: - ref: console-appender - ref: file-prod-appender - - ref: loki-appender # 트랜잭션 로그 - 프로덕션에서는 WARN 레벨 - name: org.springframework.transaction From 95878b3a4a31beaaee79040d652769ddb066a31d Mon Sep 17 00:00:00 2001 From: can019 Date: Wed, 17 Sep 2025 17:28:43 +0900 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20Ci=EC=97=90=EC=84=9C=20env=EA=B0=80?= =?UTF-8?q?=20loki=EB=A1=9C=20=EB=93=A4=EC=96=B4=EA=B0=80=EC=A7=80=20?= =?UTF-8?q?=EC=95=8A=EB=8A=94=20=EB=B2=84=EA=B7=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy-java.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-java.yml b/.github/workflows/deploy-java.yml index 4cf1ad38..3841fa44 100644 --- a/.github/workflows/deploy-java.yml +++ b/.github/workflows/deploy-java.yml @@ -28,9 +28,9 @@ jobs: echo "DB_USER=${{ secrets.DB_USER }}" >> .env.prod echo "DB_PASS=${{ secrets.DB_PASS }}" >> .env.prod echo "DB_NAME=${{ secrets.DB_NAME }}" >> .env.prod - echo "ENV_NAME=${{ secrets.LOKI_URL }}" >> .env.prod - echo "ENV_NAME=${{ secrets.LOKI_USERNAME }}" >> .env.prod - echo "ENV_NAME=${{ secrets.LOKI_PASSWORD }}" >> .env.prod + echo "LOKI_URL=${{ secrets.LOKI_URL }}" >> .env.prod + echo "LOKI_USERNAME=${{ secrets.LOKI_USERNAME }}" >> .env.prod + echo "LOKI_PASSWORD=${{ secrets.LOKI_PASSWORD }}" >> .env.prod echo "ENV_NAME=${{ secrets.ENV_NAME }}" >> .env.prod - name: Set repo lowercase