我怎么能生成不同的HTML URL路径单独的日志? [英] How can I generate seperate logs for different HTML URL paths?

查看:154
本文介绍了我怎么能生成不同的HTML URL路径单独的日志?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想根据目录访问冲出重围我的网站的记录,所以我正在寻找一个阐述这个回答(或本回答太):在哪个文件放置建议的答案吗?

I'm trying to breakout the logging of my website based on directory access, so I'm seeking an elaboration to this answer (or this answer too): In which file do place the suggested answer?

我把我的 /etc/apache2/apache2.conf中(实际上是通过一个包括我-logging.conf

I put the following in my /etc/apache2/apache2.conf (actually via an Include my-logging.conf):

SetEnvIf Request_URI "^/download/.+$" download_access
CustomLog /home/jamie/apache-logs/download.log common env=download_access

目录 /家庭/杰米/ Apache的日志/ 和文件均属普遍可写的,但是当我通过浏览器访问的资源( HTTP://download/index.html )的主要访问日志( /var/log/access.log )的更新,但不是日志我希望是: /home/jamie/apache-logs/download.log 保持不变。

The directory /home/jamie/apache-logs/ and the files therein are universally writable, but when I access the resource via my browser (http://download/index.html) the main access log (/var/log/access.log) is updated but not the log I was hoping would be: /home/jamie/apache-logs/download.log remains untouched.

我相当肯定 mod_setenvif 已启用:

$ sudo a2enmod setenvif
Module setenvif already enabled

我怎样才能使这项工作?

How can I make this work?

推荐答案

头巴掌!

正前pression错误:

Regular expression error:

SetEnvIf Request_URI "^/download/.+$" download_access

应该是:

SetEnvIf Request_URI "^/download/.*$" download_access

请注意在 * +

这篇关于我怎么能生成不同的HTML URL路径单独的日志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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