已启用日志级别,但仍然无法在 Apache 服务器上看到 POST 数据



我真的很喜欢forensic_module的格式,但我知道我可能无法获得同样水平的漂亮格式mod_dumpio.但是,我遇到的问题是我启用了所有选项来记录尽可能多的数据,但我仍然无法在任何日志中的任何位置看到 POST 数据。

这是我的虚拟主机的样子:

<VirtualHost *:80>
DocumentRoot /var/www/html/
ServerName www.random.com
ServerAlias random.com
<Directory /var/www/html>
AllowOverride All 
Options -MultiViews
Require all granted
</Directory>
<IfModule log_forensic_module> 
ForensicLog /var/www/html/forensic.log
</IfModule> 
<IfModule dumpio_module>
DumpIOInput On
DumpIOOutput On
LogLevel trace7
</IfModule>
ErrorLog /var/www/html/error.log
CustomLog /var/www/html/access.log combined
</VirtualHost>

虽然我可以看到我的网站(我有一个本地主机条目供 www.random.com(,但我甚至可以发布到论坛。在日志文件中,我可以看到引用标头和其他 HTTP 标头,但我从我的 POST 参数中看不到任何内容。

我已经使用 Web 代理确认确实正在提交 POST 数据,但我仍然不知道为什么它没有显示在任何日志文件中。

我做错了什么?我也尝试过LogLevel debug,但没有任何结果。

看起来其他帖子表明这也不起作用,所以我只是使用一个确实有效的替代方案:

<IfModule security2_module> 
# Enable the module.
SecRuleEngine On
SecAuditEngine on
# Setup logging in a dedicated file.
SecAuditLog /path/to/directory/website-audit.log
# Allow it to access requests body.
SecRequestBodyAccess on
SecAuditLogParts ABIFHZ
# Setup default action.
SecDefaultAction "nolog,noauditlog,allow,phase:2"
# Define the rule that will log the content of POST requests.
SecRule REQUEST_METHOD "^POST$" "chain,allow,phase:2,id:123"
SecRule REQUEST_URI ".*" "auditlog"
</IfModule> 

最新更新