Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to implement apache to record request response time log

Shulou Source: shulou.com Published: 2022-06-02 00:23:33 10月03日 Update

This article is about how to implement apache to record request response time logs. The editor thought it was very practical, so I shared it with you as a reference. Let's follow the editor and have a look.

The specific steps are as follows:

Locate the apache configuration file

Netstat-nap | grep 8 processes find the corresponding port process 31114tcp6 0: 4430: * LISTEN 31114/httpdps auxf | grep 3111 processes find the path to the configuration file * .conf in the process command corresponding to apache, and modify the configuration file to the specified path, such as vim httpd.conf

Modify the VirtualHost under the specified port

.CustomLog "/ var/prof.log"[% a]% {F% T} t id=% {APIIndex} I time=%D (us) url=%U%q" Directive: CustomLog "/ var/prof.log"[% a]% {% F% T} t id=% {APIIndex} I time=%D (us) url=%U%q"

% D-official explanation: Time taken to process the request, in millis, the time to process the request in microseconds

% T-official explanation: Time taken to process the request, in seconds, the time in seconds to process the request

% {ms} T-official explanation: Time taken to commit the response, in millis, the time to submit the response in milliseconds

Restart apache after modification, and observe the log output data as follows:

[200.200.222.95] 2019-03-04 15:39:32 id=- time=100107 (us) url=/apps/secvisual/home/home/on_dev_ management [200.200.222.95] 2019-03-04 15:39:38 id=- time=106476 (us) url=/apps/secvisual/home/home/on_dev_ management [200.200.222.95] 2019-03-04 15:39:43 id=- time=101263 (us) url=/apps/secvisual/home/home/on_dev_manage [200.200.222.95] 2019-03-04 15:39:48 id=- time=101333 (us) url=/apps/secvisual/home/home/on_dev_manage thank you for reading! On how to achieve apache recording request response time log is shared here, I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it and let more people see it.

Tags: Time log unit official file explanation configuration content more port path process processing good practical command instruction data article step Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi vpn Redmi Microsoft OPPO Reno