How can I generate seperate logs for different HTML URL paths?

后端 未结 2 1788
渐次进展
渐次进展 2021-01-24 23:47

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 sugge

相关标签:
2条回答
  • 2021-01-24 23:49

    Head Slap!

    Regular expression error:

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

    should be:

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

    Note the * versus the +.

    0 讨论(0)
  • 2021-01-24 23:55

    EDIT:

    No, it was the regex. Head slap is right.


    Have you looked to see if there are places in /etc/apache2/apache2.conf or in the other included sites files (maybe /etc/apache2/sites-enabled/foo.conf or /etc/apache2/conf/foo.conf or something... I use a different distro) that have different CustomLog definitions?

    There is more than likely something over-riding your statement. The best place to put the CustomLog directive is in the <VirtualHost> stanza that defines your site. That way, the directive will have the highest precedence so it will override the server-wide settings. What I think is happening is that your definition is setting a default for the server, but a more specific customlog statement is inside a VirtualHost and overriding it.

    0 讨论(0)
提交回复
热议问题