Skip to content

Commit 890f6d9

Browse files
committed
[!HOTFIX] 에러 로그 전송 시 클라이언트 IP도 추가
1 parent c0b7460 commit 890f6d9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/Ness/Backend/infra/discord/DiscordMessageGenerator.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ public DiscordMessageDto createMessage(Exception exception, HttpServletRequest h
3333
+ "### 🔗 요청 엔드포인트\n"
3434
+ httpServletRequest.getRequestURI()
3535
+ "\n"
36+
+ "### 🧐 요청 클라이언트 IP\n"
37+
+ getRemoteIp(httpServletRequest)
38+
+ "\n"
3639
+ "### 🖥️ 에러 발생 서버\n"
3740
+ activeProfile
3841
+ "\n"
@@ -51,4 +54,9 @@ private String getStackTrace(Exception exception) {
5154
exception.printStackTrace(new PrintWriter(stringWriter));
5255
return stringWriter.toString();
5356
}
57+
58+
/* 클라이언트 요청 IP 알아내기 */
59+
private String getRemoteIp(HttpServletRequest httpServletRequest){
60+
return httpServletRequest.getRemoteAddr();
61+
}
5462
}

0 commit comments

Comments
 (0)