-
Notifications
You must be signed in to change notification settings - Fork 0
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
[FEAT] Prod 환경 로그 설정 #201
[FEAT] Prod 환경 로그 설정 #201
Conversation
- prod 환경에 dev 파일을 변경함 - 잘못 변경된 dev 파일 롤백, prod 파일 재설정
- 홈 디렉토리 위치의 상대값으로 설정
- 로그 위치를 secret에서 입력받도록 수정
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
로그 설정 네이스~~
고생했어요 꺽찬 👍🏻
<file>${LOG_PATH}/ddangkong.log</file> | ||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy"> | ||
<fileNamePattern>${LOG_PATH}/ddangkong-%d{yyyy-MM-dd}.log</fileNamePattern> <!-- 매일 새로운 파일 생성 --> | ||
<maxHistory>365</maxHistory> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문)
1년인 이유가 있나요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
일단 운영 환경의 로그는 (개발 환경 보다는) 길게 해야 한다고 생각합니다. 그래서 사용자의 불편함 등을 더 많은 정보로 트래킹 할 수 있기 때문이죠.
그렇다고 딱 1년인 이유는 없습니다. 더 길면 길수록 좋다고 생각하는데, 하드 용량을 생각해서 대충 1년 설정했습니다. 트래킹 하면서 조정해봐야 될 것 같습니다.
</appender> | ||
|
||
<!-- ddangkong 하위 패키지의 logger 설정 --> | ||
<logger name="ddangkong" level="DEBUG" additivity="false"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
의견)
prod는 INFO로 운영하기로 했으니 변경 부탁드려요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아 맞다;; 수정하겠습니다!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
고생하셨어요 커찬~ 질문 의견 몇 가지 남겨두었는데 확인 부탁해요~~!
.github/workflows/be-cd-prod.yml
Outdated
@@ -38,7 +38,7 @@ jobs: | |||
run: ./gradlew bootJar | |||
|
|||
- name: Stop existing Java Application | |||
run: ps -ef | grep 'ddangkong-0.0.1-SNAPSHOT.jar' | awk '{print $2}' | xargs sudo kill -15 | |||
run: ps -ef | grep 'ddangkong-0.0.1-SNAPSHOT.jar' | awk '{print $2}' | xargs sudo kill -15 || true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
의견) jar파일 이름은 버전에 따라 변경될 수도 있을 것 같은데 스프링애플리케이션을 띄우는 포트를 사용해서 처리하는 것은 어떨까요?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
흠... 일부러 몇 번 포트에서 띄우는지 시크릿으로 숨겼는뎁... 여기서 명시해버리면...
더 좋은 방법 없을까요? 추천 받습니다~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
어차피 스프링 애플리케이션 aws private ip로 띄우니 외부 접근 안돼서 괜찮지 않나 싶지만
그래도 보안적 요소니까 다른 제안을 드리자면
java -jar 로 찾는 것도 방법일 것 같네용
.github/workflows/be-cd-prod.yml
Outdated
|
||
- name: Start Java Application | ||
run: sudo nohup java -jar ddangkong-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod & | ||
run: sudo nohup java -jar ./build/libs/ddangkong-0.0.1-SNAPSHOT.jar --spring.profiles.active=prod & |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
사소한 의견) dev환경은 -Dspring.profiles.active=prod
이런 형태로 active profile 세팅을 해주는데
통일하는 것은 어떻게 생각하세요??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
반영하겠습니다~
</layout> | ||
<username>prod-error-alert-bot</username> | ||
<avatarUrl> | ||
https://velog.velcdn.com/images/gwichanlee/post/c03a74cc-07fd-45ee-bfff-7b5147522f89/image.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
질문) 요 사진은 정말 그대로 가시나요 ㅋㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
뭐 개발 환경에서도 잘 사용하는데요 ㅋㅋ
해당 정보는 사용자한테 노출 안되는 정보라 크게 상관 없을 것 같아요~
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
전 좋아요 ㅋㅋㅋㅋㅋ
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
노출되면 인플루언서로 전직하죠
- 프로파일 설정 명령어 통일을 위해 실행 명령어 수정
</layout> | ||
<username>prod-error-alert-bot</username> | ||
<avatarUrl> | ||
https://velog.velcdn.com/images/gwichanlee/post/c03a74cc-07fd-45ee-bfff-7b5147522f89/image.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
노출되면 인플루언서로 전직하죠
- 다른 실행 명령어들과 맞추기 위해 수정
Issue Number
Closed #194
As-Is
To-Be
Check List
Test Screenshot
(Optional) Additional Description
로그 정책
파일 저장 로그
디스코드 알림
참고 자료