Skip to content

Commit

Permalink
[Setting] 로그 관련 설정 (#374)
Browse files Browse the repository at this point in the history
* feat: batch size 환경 변수로 분리

* feat: 로그 테스트를 위한 API 추가
  • Loading branch information
jjddhh committed Aug 23, 2023
1 parent 70b9789 commit 23e9223
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/be-release-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ jobs:
PINPOINT_AGENT_ID=${{ steps.generate-pinpoint.outputs.pinpoint }}
REDIS_URL=${{ secrets.REDIS_URL }}
REDIS_PORT=${{ secrets.REDIS_PORT }}
BATCH_FETCH_SIZE=${{ secrets.BATCH_FETCH_SIZE }}
tags: |
softeerh5/my-car-master:latest
Expand Down
2 changes: 2 additions & 0 deletions BE-MyCarMaster/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ARG ESTIMATE_LINK
ARG SERVER_URL
ARG REDIS_URL
ARG REDIS_PORT
ARG BATCH_FETCH_SIZE

COPY ${JAR_FILE} app.jar
COPY config/pinpoint-agent pinpoint-agent
Expand All @@ -29,6 +30,7 @@ ENV ESTIMATE_LINK=${ESTIMATE_LINK}
ENV SERVER_URL=${SERVER_URL}
ENV REDIS_URL=${REDIS_URL}
ENV REDIS_PORT=${REDIS_PORT}
ENV BATCH_FETCH_SIZE=${BATCH_FETCH_SIZE}
ENV TZ=Asia/Seoul

RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import lombok.extern.slf4j.Slf4j;

@Slf4j
@RestController
public class HealthController {

Expand All @@ -22,4 +25,14 @@ public String healthCheck() {
return "Error retrieving IP and Hostname";
}
}

@GetMapping("log/info")
public void logInfo() {
log.info("info log");
}

@GetMapping("log/error")
public void logError() {
log.error("error log");
}
}
2 changes: 1 addition & 1 deletion BE-MyCarMaster/src/main/resources/application-domain.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ spring:
properties:
hibernate:
format_sql: true
default_batch_fetch_size: 100
default_batch_fetch_size: ${BATCH_FETCH_SIZE}
show-sql: true
open-in-view : false

Expand Down

0 comments on commit 23e9223

Please sign in to comment.