在tomcat的配置文件/conf/server.xml中的这一段配置是

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
pattern="%h %l %u %t &quot;%r&quot; %s %b" prefix="localhost_access_log." suffix=".txt"/>

每次访问的日志都是打在localhost_access_log.YYYY-MM-DD.txt文件中,其中YYYY-MM-DD是日期,每天一个文件。但默认的没有打印出访问的时间。可以在pattern属性中添加%Dms,就会打印出访问时间毫秒。修改后的配置为:

<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
pattern="%h %l %u %t &quot;%r&quot; %s %b %Dms" prefix="localhost_access_log." suffix=".txt"/>

访问的结果是

tomcat下web系统每次访问效率监控

其他参数的含义

tomcat下web系统每次访问效率监控

其他参数引用的文章地址为

https://www.cnblogs.com/lmmblogs/p/7428699.html

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-07-20
  • 2021-12-04
  • 2022-12-23
猜你喜欢
  • 2021-11-09
  • 2021-11-03
  • 2021-06-19
  • 2021-08-28
  • 2022-12-23
  • 2021-07-01
  • 2021-08-18
相关资源
相似解决方案