闪电狗,开发,运营和维护的好朋友!
Bolt Monitoring (flash-dog) originated in Hangzhou Sky Network Technology Co., a real project, the main advantage is lightweight, fast, non-invasive, does not affect the business code, just add a few jar log4j package and modify the configuration file, you can monitor any indicators, such as CPU, memory, threads, gaming revenue, the number of online and so on. After the 2012 Open Source in the game, pay, education and many other Internet companies a wide range of applications.
Online demo, http://115.28.11.12:8080/flash-dog/ , username: admin, password:123456
MDC.put (“UUID”, userId);
</ Code> </ pre>
log4j configuration:
log4j.appender.MongoDB.layout.ConversionPattern = {“timestamp”: “% d”, “level”: “% p”, “className”: “% c”, “message”: “% m”, “pid” : “% V”, “ip”: “% I”, uuid: “% X {UUID}”}
</ Code> </ pre>
How to monitor access log tomcat
- First configure the tomcat log output to log4j, download tomcat-juli.jar to tomcat / bin, overwriting the original jar, download tomcat-util.jar to tomcat / lib, copy log4mongo-java, flash-dog-api-log4j and mongo-java-driver, log4j.properties to lib
- Modify tomcat / conf / server.xml in the access-log section: className = “com.skymobi.tomcat.Log4JAccessLogValve”
- Restart tomcat, in logs / catalina.log can see the access log