目前项目集成参照官网引入cat客户端
<dependency>
<groupId>com.xmd</groupId>
<artifactId>cat-client</artifactId>
<version>3.0.0</version>
</dependency>
其余前置环境配置略过,注意:
Windows环境(具体在哪个盘下,取决于你的开发工具配置的运行项目的tomcat的根目录):
新建D:/data/appdatas/cat/client.xml目录和文件
新建D:/data/applogs/cat/目录
如果项目启动报错:
java.lang.ClassNotFoundException: org.codehaus.plexus.component.repository.exception.ComponentLookupException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1309)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1137)
at com.dianping.cat.servlet.CatFilter$CatHandler$1.handle(CatFilter.java:114)
at com.dianping.cat.servlet.CatFilter$Context.handle(CatFilter.java:437)
at com.dianping.cat.servlet.CatFilter.doFilter(CatFilter.java:65)
则需要引入如下jar包:
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>2.1.0</version>
</dependency>
程序启动后:
[2021-02-20 03:11:04,797] Artifact co_browser_extend:war exploded: Artifact is deployed successfully
[2021-02-20 03:11:04,797] Artifact co_browser_extend:war exploded: Deploy took 21,115 milliseconds
Logger file D:\data\applogs\cat\cat_20210220.log
[02-20 15:11:09.009] [INFO] [cat] Cat is lazy initialized!