【问题标题】:Unable to get detailed logging for apache mod_rewrite无法获取 apache mod_rewrite 的详细日志记录
【发布时间】:2015-01-22 09:00:27
【问题描述】:

我正在尝试从 mod_rewrite for apache 2.4 获取详细的日志记录消息。

apache 手册告诉我将其添加到我的虚拟主机配置中:

LogLevel alert rewrite:trace3

帖子https://stackoverflow.com/a/17279058/671639建议

LogLevel rewrite:trace3

不幸的是,apache 对它们都给出了相同的错误消息:

Syntax error on line 45 of /Applications/MAMP/conf/apache/extra/httpd-vhosts.conf:
LogLevel requires level keyword: one of emerg/alert/crit/error/warn/notice/info/debug

如果我使用LogLevel debug,mod_rewrite 不会记录任何内容。

有什么想法吗?

【问题讨论】:

    标签: apache mod-rewrite logging


    【解决方案1】:

    根据您的错误消息,您使用的是没有 trace1-trace8 LogLevels 的 Apache 2.2(或更早版本)。您需要在 pre-2.4 上使用 RewriteLog 和 RewriteLogLevel。

    【讨论】:

    • 我在 OSX 上使用 MAMP。如果我去/Applications/MAMP/bin/apache2/bin 并打电话给httpd -v 我会得到Apache/2.4.9。 phpinfo() 说Apache/2.2.25。
    • 我正在运行 Apache 2.4.25 并收到相同的错误。
    猜你喜欢
    • 2020-08-18
    • 1970-01-01
    • 2022-11-15
    • 2017-03-13
    • 2013-03-12
    • 1970-01-01
    • 2012-10-08
    • 1970-01-01
    • 2020-08-02
    相关资源
    最近更新 更多