SpringBoot内嵌Tomcat Access log 配置

tomcat的accesslog日志 D:/logs

server.tomcat.accesslog.buffered=true
server.tomcat.accesslog.enabled=true
server.tomcat.accesslog.file-date-format=.yyyy-MM-dd
server.tomcat.accesslog.pattern=%a %h %m %l %u %t %r %s %S %b %D %T %I
server.tomcat.accesslog.prefix=access_log
server.tomcat.accesslog.rename-on-rotate=false
server.tomcat.accesslog.request-attributes-enabled=false
server.tomcat.accesslog.rotate=true
server.tomcat.accesslog.suffix=.log
server.tomcat.accesslog.directory=tomcat-access-logs

tomcat日志路径

server.tomcat.basedir=D:/logs

主要字段:
server.tomcat.accesslog.pattern 解释:

%a - Remote IP address 远程IP地址
%A - Local IP address 本地IP地址
%b - Bytes sent, excluding HTTP headers, or '-' if no bytes were sent 返回给客户端的数据字节数,- 表示没有数据
%B - Bytes sent, excluding HTTP headers 与上面一样,貌似是官方的bug,应该是一个包含 HTTP headers 一个不包含
%h - Remote host name (or IP address if enableLookups for the connector is false)
%H - Request protocol
%l - Remote logical username from identd (always returns '-')
%m - Request method
%p - Local port
%q - Query string (prepended with a '?' if it exists, otherwise an empty string
%r - First line of the request
%s - HTTP status code of the response
%S - User session ID
%t - Date and time, in Common Log Format format
%u - Remote user that was authenticated
%U - Requested URL path
%v - Local server name
%D - Time taken to process the request, in millis 处理请求耗时,单位毫秒
%T - Time taken to process the request, in seconds 同上,单位秒
%I - current Request thread name (can compare later with stacktraces) 执行当前请求的线程名称,输出可以统计多少线程在工作,当然也可以通过其他方式,jstack


作者:Hare_0c32
链接:https://www.jianshu.com/p/f24b92cf2f69
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值