-
Notifications
You must be signed in to change notification settings - Fork 0
AWS CloudWatch 로깅 시스템 추가 #45
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
base: main
Are you sure you want to change the base?
Conversation
|
노션 |
|
@minibr PR 제목 수정 및 내용에 대해서도 작동 방식이나 작업 내용에 대해 자세히 부탁드립니다! |
해당 문서를 확인할 수 없는데 혹시 노션 링크 주실 수 있으실까요 ? |
제가 잘못 기재했네요. "구현된 |
리뷰 요청에 따라 PR 설명을 이해하기 쉽게 수정했습니다. |
제가 확인한 바로는, 현재 해당 설정은 환경 변수(Environment Variable)에 값을 설정한 후, 이를 통해 직접 값을 주입하는 방식으로 구성되어 있는 것 같습니다. 하지만 유지보수 측면이나 변수 값 관리(특히 개발/운영 환경 분리 등)를 고려했을 때는 해당 방식으로 변경하는 것에 대해 어떻게 생각하시나요? |
처음에는 |
보안적인 측면에서 민감한 값을 application.yml에 직접 기입하기보다는 환경 변수로 분리 관리하는 것이 바람직하다는 점에 저도 전적으로 동의합니다. 다만, 현재 저희 프로젝트의 경우:
을 고려했을 때, 보안적으로도 application.yml을 통한 관리가 큰 문제가 되지는 않을 것이라고 생각합니다. 따라서 관리 편의성과 명확성을 고려해 해당 값을 application.yml에 지정해두는 방안도 괜찮을 것 같습니다 |
| <!-- Console Appender --> | ||
| <appender name="console_log" class="ch.qos.logback.core.ConsoleAppender"> | ||
| <encoder> | ||
| <pattern>%highlight(%-5level) %date [%thread] %cyan([%C{0} :: %M :: %L]) - %msg%n</pattern> | ||
| </encoder> | ||
| </appender> | ||
|
|
||
| <!-- 개발 환경: 콘솔만 --> | ||
| <springProfile name="!prod"> | ||
| <root level="INFO"> | ||
| <appender-ref ref="console_log"/> | ||
| </root> | ||
| </springProfile> | ||
|
|
||
| <!-- 운영 환경: 콘솔 + CloudWatch --> | ||
| <springProfile name="prod"> | ||
| <root level="INFO"> | ||
| <appender-ref ref="console_log"/> | ||
| <appender-ref ref="aws_cloud_watch_log"/> | ||
| </root> | ||
| </springProfile> | ||
|
|
||
| <!-- 기본 설정 (프로필 없을 때): 콘솔만 --> | ||
| <root level="INFO"> | ||
| <appender-ref ref="console_log"/> | ||
| </root> | ||
|
|
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.
springProfile 이름만으로도 역할이 명확해서, 이 부분 주석은 제거하셔도 무방할 것 같습니다! 🙌
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.
수정했습니다!
|
로그 패턴을 어떤 식으로 구성하셨는지에 대한 간단한 부가 설명이 함께 추가되면 더 좋을 것 같습니다. |
4e6a325 to
4974326
Compare
여기서의 로그 패턴은 CloudWatch에서 로그 검색과 분석이 편하도록 대괄호로 구분된 구조화된 형태로 설정한 것 입니다. 하이라이트는 개발 시 로그 레벨 구분을 위해, 클래스/메서드/라인 정보는 문제 발생 시 코드 위치를 쉽게 파악하기 위해 포함됩니다. |
6a1b5bb to
870f8ed
Compare
관련 이슈
PR 설명
build.gradle에logback-awslogs-appender의존성 추가logback-spring.xml설정 파일 추가dev설정prod로 설정하고 AWS 환경변수 필요 (AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)CloudWatch사용Test 결과
dev프로필에서CloudWatch전송 비활성화 확인prod프로필에서 AWS 로그 그룹 생성 및 전송 성공Summary by CodeRabbit