apache2.4.7未记录"404未找到".页面到error.log [英] apache2.4.7 not logging "404 Not Found" pages to error.log

查看:127
本文介绍了apache2.4.7未记录"404未找到".页面到error.log的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看到了有关如何将404错误记录到错误日志的问题,这是相反的.

I've seen questions about how to not log 404 errors to the error log, this is the opposite.

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

For some reason my apache installation does not log 404 errors to my error log (or to my access log for that matter). I have set the error log properly and see errors going to it, but when I access non-existent pages I simply get my 404 error - the access (but not the 404 error) shows up in the access.log, but I don't see anything in the error log (which makes it hard, for example, to debug why some pages aren't showing up).

关于日志的我的Apache(2.4.7)conf设置(按设置顺序)是:

My apache (2.4.7) conf settings regarding logs (in the order they are set) are:

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

因此,我认为与错误日志(忽略覆盖设置)相关的唯一因素是:

So the only ones that I think are relevant to error log (ignoring overwritten settings) are:

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

推荐答案

最后解决了这个问题.

LogLevel需要设置为类似于'info'的信息-由于某种原因,用于记录404错误的Logwar的'warn'不再这样做.

LogLevel needs to be set to something like 'info' - for some reason the LogLevel of 'warn' which use to log 404 errors no longer does so.

我不知道'debug'是否可行,我的问题暗示那行不通,但是我也意识到我在两个地方都设置了LogLevel.

I don't know if 'debug' would work, my question implies that it wouldn't, but I also realized that I had LogLevel set in two places.

这篇关于apache2.4.7未记录"404未找到".页面到error.log的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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