javamelody 설치 방법
- Maven 프로젝트이면 pom.xml에 아래 내용 추가
<!-- javamelody-core --> <dependency> <groupId>net.bull.javamelody</groupId> <artifactId>javamelody-core</artifactId> <version>1.58.0</version> </dependency> |
- Maven 프로젝트가 아니면 lib 폴더에 jrobin-1.5.9.1.jar, javamelody.jar 추가
- Web.xml에 필터 추가
<filter> <filter-name>monitoring</filter-name> <filter-class>net.bull.javamelody.MonitoringFilter</filter-class> </filter> <filter-mapping> <filter-name>monitoring</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <login-config> <auth-method>BASIC</auth-method> <realm-name>Monitoring</realm-name> </login-config> <security-role> <role-name>monitoring</role-name> </security-role> <security-constraint> <web-resource-collection> <web-resource-name>Monitoring</web-resource-name> <url-pattern>/monitoring</url-pattern> </web-resource-collection> <auth-constraint> <role-name>monitoring</role-name> </auth-constraint> </security-constraint> |
- tomcat-users.xml에 권한정보 등록
<role rolename="monitoring"/> <user username="gnifrix" password="gni2016@" roles="monitoring" /> |
Javamelody 다운로드 받는 곳
https://github.com/javamelody/javamelody/wiki
댓글