gpt4 book ai didi

apache2.4.7 没有将 "404 Not Found"页记录到 error.log

转载 作者:行者123 更新时间:2023-12-02 01:39:26 25 4
gpt4 key购买 nike

我看到过关于如何将 404 错误记录到错误日志的问题,这是相反的。

出于某种原因,我的 apache 安装没有将 404 错误记录到我的错误日志(或与此相关的访问日志)。我已正确设置错误日志并看到错误,但是当我访问不存在的页面时,我只是收到 404 错误 - access(但不是 404 错误)显示在访问中.log,但我在错误日志中看不到任何内容(例如,这使得调试为什么某些页面未显示变得困难)。

关于日志的我的 apache (2.4.7) conf 设置(按照它们设置的顺序)是:

ErrorLog ${APACHE_LOG_DIR}/error.log
ErrorLog logs/error_log
LogLevel warn # Though I've tried setting this to debug
LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\"" common
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio
CustomLog logs/access_log common
LogFormat "%{HOST}i %h %l %u %t \"%r\" %s %b \"%{User-Agent}i\"" vcommon
CustomLog logs/access_log vcommon

所以我认为唯一与错误日志(忽略覆盖设置)相关的是:

ErrorLog logs/error_log
LogLevel warn # Though I've tried setting this to debug

最佳答案

终于明白了。

LogLevel 需要设置为“info”之类的东西——出于某种原因,用于记录 404 错误的“warn”LogLevel 不再这样做。

我不知道“调试”是否有效,我的问题暗示它不会,但我也意识到我在两个地方设置了 LogLevel。

关于apache2.4.7 没有将 "404 Not Found"页记录到 error.log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29324957/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com