【问题标题】:Log apache requests from localhost in different file在不同的文件中记录来自 localhost 的 apache 请求
【发布时间】:2015-11-26 15:39:57
【问题描述】:

我有一个带有 Apache/2.2.15 的 centos 6.7。我的网站在 /var/log/httpd/mywebsite.log 中的 Apache 日志请求。我还使用 api 并访问我使用 mywebsite.com/api 的 api。在 api 中,请求是由 localhost 发出的。问题是我们需要单独保存日志。我想必须记录文件。一个用于 mywebsite.com/api,一个用于 mywebsite.com

【问题讨论】:

    标签: apache logging centos


    【解决方案1】:
    SetEnvIf Remote_Addr ^127\.0\.0\.1 islocal
    CustomLog logs/access_log common env=!islocal
    CustomLog logs/access_log_local common env=islocal
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-10-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-14
      • 2013-10-05
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多