apache - 我们可以在 apache 2.4 中创建自定义日志文件吗?

标签 apache mod-rewrite aem

对于 Apache 2.2,我们使用以下内容 -

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

RewriteLog "logs/rewrite_test1.log"
 RewriteLogLevel 1

如何在 Apache 2.4 中替换它们。

最佳答案

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

Those familiar with earlier versions of mod_rewrite will no doubt be looking for the RewriteLog and RewriteLogLevel directives. This functionality has been completely replaced by the new per-module logging configuration mentioned above. To get just the mod_rewrite-specific log messages, pipe the log file through grep: tail -f error_log|fgrep '[rewrite:'d.

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

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

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

Example: LogLevel alert rewrite:trace3

关于apache - 我们可以在 apache 2.4 中创建自定义日志文件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45377606/

相关文章:

apache - 为什么我的 mod_rewrite 不能像 HTTP 那样用于 HTTPS

java - 由 : java. lang.ClassNotFoundException : net. com.myproject.core 找不到 sf.json.xml.XMLSerializer 引起 [35154]

apache - 日文字母在我的页面中显示不正确

apache - 你如何让apache在一个帖子上返回一个状态200响应代码到一个url

apache - mod_rewrite 规则附加 index.html 如果不存在

aem - 多字段组件问题

java - 将多个 Assets 上传到 DAM 会扰乱工作流程步骤

java - 为什么推测执行对 Giraph 没有意义?

php - 在php套接字中建立持久连接,以避免太多的apache实例

C#: 在 ProxyPass 之后获取 Client-IP