-
Notifications
You must be signed in to change notification settings - Fork 8
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
[BE] 로깅 프레임워크 적용과 모니터링 대시보드 구성(#204) #232
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
6d07e39
fix: REMOTE_ORIGIN 그냥 변수로 변경
youngsu5582 1e66637
Merge branch 'develop' of https://github.com/woowacourse-teams/2024-c…
youngsu5582 6586649
feat: 에러 로그 레벨 상세화
youngsu5582 b27f1cd
feat: 로직 내 info 로그 명시
youngsu5582 3470692
feat: 로직 내 debug 로그 명시
youngsu5582 6b390ed
feat: MDC 필터 추가
youngsu5582 7d4f085
feat: Appedner, logback-spring 설정 추가
youngsu5582 09130b1
feat: .gitignore 추가, application 설정파일 추가
youngsu5582 0ec7629
Merge branch 'develop' into feat/#204
youngsu5582 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,7 @@ | |
|
||
### macOS ### | ||
.DS_Store | ||
|
||
### Log ### | ||
|
||
logs/**/*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
backend/src/main/java/corea/global/filter/MdcRequestLoggingFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package corea.global.filter; | ||
|
||
import jakarta.servlet.*; | ||
import org.slf4j.MDC; | ||
import org.springframework.core.Ordered; | ||
import org.springframework.core.annotation.Order; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.io.IOException; | ||
import java.util.UUID; | ||
|
||
@Component | ||
@Order(Ordered.HIGHEST_PRECEDENCE) | ||
class MdcRequestLoggingFilter implements Filter { | ||
@Override | ||
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { | ||
UUID uuid = UUID.randomUUID(); | ||
MDC.put("requestId", uuid.toString()); | ||
chain.doFilter(request, response); | ||
MDC.clear(); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -5,6 +5,8 @@ | |||||||
import corea.matching.domain.MatchResult; | ||||||||
import corea.matching.repository.MatchResultRepository; | ||||||||
import lombok.RequiredArgsConstructor; | ||||||||
import org.apache.logging.log4j.LogManager; | ||||||||
import org.apache.logging.log4j.Logger; | ||||||||
import org.springframework.stereotype.Service; | ||||||||
import org.springframework.transaction.annotation.Transactional; | ||||||||
|
||||||||
|
@@ -13,11 +15,13 @@ | |||||||
@Transactional(readOnly = true) | ||||||||
public class ReviewService { | ||||||||
|
||||||||
private static final Logger log = LogManager.getLogger(ReviewService.class); | ||||||||
private final MatchResultRepository matchResultRepository; | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
@Transactional | ||||||||
public void review(long roomId, long reviewerId, long revieweeId) { | ||||||||
MatchResult matchResult = getMatchResult(roomId, reviewerId, revieweeId); | ||||||||
log.info("리뷰 완료[{매칭 ID({}), 리뷰어 ID({}, 리뷰이 ID({})", matchResult.getId(), reviewerId, revieweeId); | ||||||||
matchResult.reviewComplete(); | ||||||||
} | ||||||||
|
||||||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
👍