hanseom 2022. 5. 20. 12:20
반응형

Overview

  해당 글에서는 Spring Boot에서 자체적으로 제공해주는 Actuator 기능에 대해 알아보겠습니다. Actuator 기능을 통해 애플리케이션을 모니터링하고 관리할 수 있습니다.

 

Dependency

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

 

Actuator

  의존성을 추가하고 서버를 기동한 후 http://localhost:8088/actuator 접속하면 HATEOAS가 적용된 아래와 같은 결과를 확인할 수 있습니다. http://localhost:8088/actuator/health를 통해 health check가 가능합니다.

  보다 많은 정보를 확인하기 위해 application.yml 파일을 수정합니다.

# port 변경
server:
  port: 8088

# logging level 변경
logging:
  level:
    org.springframework: info

# 다국어 파일명 지정
spring:
  messages:
    basename: messages

# actuator
management:
  endpoints:
    web:
      exposure:
        include: "*"

 

  서버 재기동 후 http://localhost:8088/actuator 접속하면 cache, health, env, logger 등 다양한 정보를 확인할 수 있습니다.

이하 생략...

반응형