How to obtain Tomcat's access log when the spring boot project runs the jar package

When creating the war package, you only need to put the war package under the external Tomcat webapps, and the relevant logs can be seen directly in the logs directory, but how to obtain the jar package, in fact, you can also obtain the log file through the application setting file.

Take spring boot 2.7.8 as an example

server.tomcat.accesslog.enabled = true// 开启accesslog日志,默认false
server.tomcat.basedir = ./log // 设置日志文件根目录,默认为系统缓存目录

Through the setting of the above two parameters, we can get the web access log we need. Of course, more parameters can be set. For other parameter settings, please refer to the following URL .

Guess you like

Origin blog.csdn.net/a7442358/article/details/129068209