【问题标题】:Can we create a custom log file in apache 2.4?我们可以在 apache 2.4 中创建自定义日志文件吗?
【发布时间】:2018-01-04 18:23:18
【问题描述】:

对于 Apache 2.2,我们在下面使用 -

RewriteLog "/etc/httpd/logs/rewrite.log"
RewriteLogLevel 1

RewriteLog "logs/rewrite_test1.log"
 RewriteLogLevel 1

如何在 Apache 2.4 中替换它们。

【问题讨论】:

    标签: apache mod-rewrite aem


    【解决方案1】:

    根据Apache HTTP documentation,看起来重写日志现在包含在错误日志中,您需要从中提取数据:

    那些熟悉早期版本的 mod_rewrite 的人无疑会寻找 RewriteLog 和 RewriteLogLevel 指令。此功能已完全被上面提到的新的每模块日志记录配置所取代。 要仅获取特定于 mod_rewrite 的日志消息,请通过 grep 管道传输日志文件: tail -f error_log|fgrep '[rewrite:'d.

    错误日志的路径可以这样定义(more info there):

    错误日志“/var/log/httpd/error_log”

    要控制重写日志级别,您可以像这样使用LogLevel Directive

    示例:LogLevel 警报重写:trace3

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-02-25
      • 2020-09-17
      • 2023-03-23
      • 1970-01-01
      • 2013-01-26
      • 2011-12-21
      相关资源
      最近更新 更多