是否可以使用Apache记录所有HTTP请求标头? [英] Is it possible to log all HTTP request headers with Apache?

查看:415
本文介绍了是否可以使用Apache记录所有HTTP请求标头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将apache收到的HTTP请求标头(全部)的内容记录到日志文件中?

How to make a record into the logfile the contents of the HTTP request header (all) as received by apache?

当前我的Apache组合日志格式配置为:

Currently my apache combined log format configuration is:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\"" combined

我知道可以这样做:

LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" \"%{Cookie}i\" \"%{heading name}i\" \"%{heading name}i\" \"%{heading name}i\"" combined

但是它不合逻辑,并且不可能知道哪个标题.

but it is not logical and it is not possible to know which headers will be.

推荐答案

mod_log_forensic 是您想要的,但是默认情况下,Apache安装中可能不包含/不提供它.

mod_log_forensic is what you want, but it may not be included/available with your Apache install by default.

这里是使用方法.

LoadModule log_forensic_module /usr/lib64/httpd/modules/mod_log_forensic.so 
<IfModule log_forensic_module> 
ForensicLog /var/log/httpd/forensic_log 
</IfModule> 

这篇关于是否可以使用Apache记录所有HTTP请求标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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