debugging - 如何在 Apache2 服务器上启用日志级别调试

标签 debugging apache2 error-logging

我的错误日志包含:

Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

我替换了 apache 配置文件上的日志级别:

LogLevel debug

重新启动后,我收到相同的错误消息,但没有所谓的“回溯”。据我了解,应该有 mod_rewrite 正则表达式生成的那 10 行重定向。

在互联网上搜索后,我发现了很多关于 loglevel 和 mod_rewrite 的解释,但没有提到如何使 loglevel 调试工作。

有什么想法吗?

最佳答案

请注意,在较新的 Apache 版本中,RewriteLogRewriteLogLevel 已被删除,事实上,现在在尝试启动 Apache 时会触发错误(至少在我的使用 Apache 2.4.2 安装 XAMPP):

AH00526: Syntax error on line xx of path/to/config/file.conf: Invalid command 'RewriteLog', perhaps misspelled or defined by a module not included in the server configuration`

相反,您现在应该使用通用 LogLevel 指令,级别为 trace1trace8。 “debug”没有在日志中为我显示任何重写消息。

示例:LogLevel warn rewrite:trace3

官方文档,see here .

当然这也意味着现在你的重写日志将被写入通用错误日志文件中,你必须自己整理它们。

关于debugging - 如何在 Apache2 服务器上启用日志级别调试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5641618/

相关文章:

c# - 用于 windows .netcore 应用程序的 Logstash

java - ava.lang.ClassCastException : android. support.v7.widget.AppCompatTextView 无法转换为 android.widget.EditText

c++ - 错误! constexpr 变量必须由常量表达式 constexpr 初始化

c# - 调试器没有跳过/进入异步/等待

apache - 使用 htaccess 将子域重写到子文件夹

linux - 如何使用 Logrotate 保留 14 天的日志?

windows - 跟踪在 VB.net 应用程序中调用的外部 .EXE 的参数

PHP "mail()"函数从 php5 cli 发送邮件,但在浏览器运行脚本时不发送邮件

elasticsearch - Filebeat 默认仪表板 : no results found

javascript - (错误)日志记录的最佳实践