Skip to content

Commit

Permalink
fix logging
Browse files Browse the repository at this point in the history
  • Loading branch information
장준하 authored and 장준하 committed Aug 7, 2024
1 parent 2651ce6 commit 408ae17
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,6 @@ public boolean preHandle(HttpServletRequest request, HttpServletResponse respons
System.out.println(headerName + ": " + request.getHeader(headerName));
}

// 파라미터 로그
System.out.println("Parameters:");
Enumeration<String> parameterNames = request.getParameterNames();
while (parameterNames.hasMoreElements()) {
String paramName = parameterNames.nextElement();
System.out.println(paramName + ": " + request.getParameter(paramName));
}

// 바디 로그 (선택 사항, 바디를 여러 번 읽을 수 없으므로 주의)
System.out.println("Body:");
StringBuilder body = new StringBuilder();
BufferedReader reader = request.getReader();
String line;
while ((line = reader.readLine()) != null) {
body.append(line);
}
System.out.println(body.toString());
return true;
}
}

0 comments on commit 408ae17

Please sign in to comment.