什么是tomcat中的localhost访问登录? [英] What is localhost access log in tomcat?

查看:36
本文介绍了什么是tomcat中的localhost访问登录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道tomcat中的本地主机访问日志是什么?我们可以通过这些日志监控哪些信息,以及如何通过 Java 程序读取它们?

I want to know what is local host access log in tomcat ? what information we can monitor by these logs and how to read them through a Java program?

推荐答案

访问日志包含每个访问服务器的请求的信息.它可用于跟踪页面点击次数、用户会话活动等,因为它会记录所有传入请求以及时间戳、请求 HTTP 方法和 HTTP 响应代码.

The access log contains the information for each request that hits the server. It can be used to track page hit counts, user session activity, and so on because it logs all the incoming requests along with Timestamp, Request HTTP Method and the HTTP Response code.

示例日志语句如下

46.181.252.151  - - [22/Feb/2019:19:04:19 +0000] "GET /task/768476366 HTTP/1.1" 200 6765
36.231.298.259  - - [22/Feb/2019:19:04:20 +0000] "GET /doc/wallet/9855563 HTTP/1.1" 200 45564

常见日志模式 ="%h %l %u %t "%r" %s %b"

Common logging pattern ="%h %l %u %t "%r" %s %b"

%h – Remote hostname (or IP address if the resolveHosts attribute is set to false; by default the value is false).
%l – Remote logical user name; this is always a hyphen (-).
%u – Remote user that has been authenticated. In the example, "admin" and a hyphen (-). If there is none, it’s a hyphen (-).
%t – Date and time in common log file format.
%r – The first line of the request. In the example, "GET / HTTP/1.1" (note that this is configured to be shown within quotes ("")).
%s – The HTTP status code of the response. In the example 200 is the OK status.
%b – Bytes sent count, excluding HTTP headers, and shows a hyphen (-) if zero.

欲知更多详情点击此处

这篇关于什么是tomcat中的localhost访问登录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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