You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
6️⃣ 헬스 정보
7️⃣ 애플리케이션 정보
✅ build
✅ git
8️⃣ 로거
loggers 엔드포인트를 사용하면 로깅과 관련된 정보를 확인할 수 있고 실시간으로 변경도 할 수 있다.
LogController
✅ loggers 엔드포인트 호출
{ "levels": [ "OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE" ], "loggers": { "ROOT": { "configuredLevel": "INFO", "effectiveLevel": "INFO" }, "SQL dialect": { "effectiveLevel": "INFO" }, "_org": { "effectiveLevel": "INFO" }, "_org.springframework": { "effectiveLevel": "INFO" }, "_org.springframework.web": { "effectiveLevel": "INFO" }, "_org.springframework.web.servlet": { "effectiveLevel": "INFO" }, "_org.springframework.web.servlet.HandlerMapping": { "effectiveLevel": "INFO" }, "_org.springframework.web.servlet.HandlerMapping.Mappings": { "effectiveLevel": "INFO" }, "hello.controller.LogController": { "effectiveLevel": "DEBUG" }, } }✅ 더 자세히 조회하기 → 패턴을 이용
{ "configuredLevel": "DEBUG", "effectiveLevel": "DEBUG" }✅ 실시간 로그 레벨 변경
보통 개발 서버에서는 DEBUG까지만 로그를 사용
운영 서버는 요청이 너무 많기 때문에 DEBUG까지 출력하면 엄청 많이 출력한다. → 모두 출력하면 성능, 디스크에 영향을준다.
운영 서버는 INFO까지만 하는걸 추천
서비스 운영중에 문제가 있어서 급하게
DEBUG나TRACE로그를 남겨서 확인해야 확인하고 싶다면 어떻게 해야할까?loggers엔드포인트를 사용하면 애플리케이션을 다시 시작하지 않고, 실시간으로 로그 레벨을 변경할 수 있다.POST로 전달하는 내용 JSON
content/type도application/json으로 전달해야 한다.{ "configuredLevel": "TRACE" }configuredLevel이TRACE로 변경된 것을 확인할 수 있다.{ "configuredLevel": "TRACE", "effectiveLevel": "TRACE" }TRACE레벨까지 출력되는 것을 확인9️⃣ HTTP 요청 응답 기록
HTTP 요청과 응답의 과거 기록을 확인하고 싶다면 httpexchanges 엔드포인트를 사용
HttpExchangeRepository 인터페이스의 구현체를 빈으로 등록하면 httpexchanges 엔드포인트를 사용할 수 있다. ( 해당 빈을 등록하지 않으면 httpexchanges 엔드포인트를 활성화 되지않는다.)
스프링 부트는 기본으로
InMemoryHttpExchangeRepository구현체를 제공한다.InMemoryHttpExchangeRepository 추가
{ "exchanges": [ { "timestamp": "2025-08-22T15:11:25.200053Z", "request": { "uri": "http://localhost:8080/log", "method": "GET", "headers": { "host": [ "localhost:8080" ], "connection": [ "keep-alive" ], "sec-ch-ua": [ "\"Not;A=Brand\";v=\"99\", \"Google Chrome\";v=\"139\", \"Chromium\";v=\"139\"" ], "sec-ch-ua-mobile": [ "?0" ], "sec-ch-ua-platform": [ "\"macOS\"" ], "upgrade-insecure-requests": [ "1" ], "user-agent": [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" ], "accept": [ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" ], "sec-fetch-site": [ "none" ], "sec-fetch-mode": [ "navigate" ], "sec-fetch-user": [ "?1" ], "sec-fetch-dest": [ "document" ], "accept-encoding": [ "gzip, deflate, br, zstd" ], "accept-language": [ "ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7" ] } }, "response": { "status": 200, "headers": { "Content-Type": [ "text/html;charset=UTF-8" ], "Content-Length": [ "2" ], "Date": [ "Fri, 22 Aug 2025 15:11:25 GMT" ], "Keep-Alive": [ "timeout=60" ], "Connection": [ "keep-alive" ] } }, "timeTaken": "PT0.065599S" }, { "timestamp": "2025-08-22T15:11:12.304301Z", "request": { "uri": "http://localhost:8080/actuator/httpexchanges", "method": "GET", "headers": { "host": [ "localhost:8080" ], "connection": [ "keep-alive" ], "sec-ch-ua": [ "\"Not;A=Brand\";v=\"99\", \"Google Chrome\";v=\"139\", \"Chromium\";v=\"139\"" ], "sec-ch-ua-mobile": [ "?0" ], "sec-ch-ua-platform": [ "\"macOS\"" ], "upgrade-insecure-requests": [ "1" ], "user-agent": [ "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36" ], "accept": [ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7" ], "sec-fetch-site": [ "none" ], "sec-fetch-mode": [ "navigate" ], "sec-fetch-user": [ "?1" ], "sec-fetch-dest": [ "document" ], "accept-encoding": [ "gzip, deflate, br, zstd" ], "accept-language": [ "ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7" ] } }, "response": { "status": 200, "headers": { "Content-Type": [ "application/vnd.spring-boot.actuator.v3+json" ], "Transfer-Encoding": [ "chunked" ], "Date": [ "Fri, 22 Aug 2025 15:11:12 GMT" ], "Keep-Alive": [ "timeout=60" ], "Connection": [ "keep-alive" ] } }, "timeTaken": "PT0.029559S" } ] }1️⃣0️⃣ 액츄에이터와 보안
✅ 보안 주의
✅ 액추에이터를 다른 포트에서 실행
예를 들어서 외부 인터넷 망을 통해서 8080 포트에만 접근할 수 있고, 다른 포트는 내부망에서만 접근할 수 있다면 액츄에이터에 다른 포트를 설정하면 된다.
application.yml 에서 수정된 내용
✅ 액츄에티어 URL 경로에 인증 설정
/actuator경로에 서블릿 필터, 또는 스프링 시큐티리를 통해서 인증된 사용자만 접근 가능하도록 추가 개발이 필요하다.✅ 엔드포인트 경로 변경
Beta Was this translation helpful? Give feedback.
All reactions