如何通过web查看tomcat日志

在实际开发中,我们经常要看tomcat日志来定位问题。但并不是所有人都会linux命令,所以通过web即访问浏览器的方式来查看日志是最好不过的了。

那么如何配置呢?

修改配置文件即可。

1.修改tomcat/conf/server.xml

<Context path="/logs" docBase="D:/Program Files/tomcat7-zabbix/logs" debug="0" reloadbale="true"/>

2.修改tomcat/conf/web.xml


listings
true

启动tomcat, 访问 http://localhost:8080/logs/

注意:生产环境需要加上权限校验。

0%