Spring Boot启用http请求记录 [英] Spring Boot enable http requests logging

查看:151
本文介绍了Spring Boot启用http请求记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在spring boot提供的嵌入式tomcat服务器中启用http服务器日志?我在 application.properties 中尝试了这个,但它没有创建文件,也没有登录到控制台

How to enable http server logs in an embedded tomcat server provided by spring boot? I've tried this in application.properties but it doesn't create file, neither logs to console

#application.properties
server.tomcat.access-log-enabled=true
server.tomcat.access-log-pattern=%a asdasd
logging.file=/home/mati/mylog.log
spring boot 1.0.1.RELEASE


推荐答案

尝试

server.tomcat.accessLogEnabled=true
server.tomcat.accessLogPattern=%a asdasd

并查看 /tmp/tomcat.<随机>。< port> / logs 输出文件。设置 server.tomcat.basedir 属性以更改目录。

and look in /tmp/tomcat.<random>.<port>/logs for the output files. Set server.tomcat.basedir property to change the directory.

这篇关于Spring Boot启用http请求记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆