美文网首页
SpringBoot内嵌Tomcat Access log 配

SpringBoot内嵌Tomcat Access log 配

作者: Hare_0c32 | 来源:发表于2020-09-09 18:13 被阅读0次

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

相关文章

网友评论

      本文标题:SpringBoot内嵌Tomcat Access log 配

      本文链接:https://www.haomeiwen.com/subject/ejqyektx.html