Generate access logs for different subdirectories in Apache
Asked Answered
I

1

15

I have some sub-applications in my site, for example:

http://server/app/subapp1
http://server/app/subapp2

How can I generate different log files for each directory?

http://server/app/subapp1/log/access_log

http://server/app/subapp2/log/access_log
Intertidal answered 22/9, 2009 at 15:24 Comment(0)
C
16

Try this:

SetEnvIf Request_URI ^/app/subapp1(/|$) subapp1
SetEnvIf Request_URI ^/app/subapp2(/|$) subapp2

CustomLog /absolute/path/to/app/subapp1/log/access_log common env=subapp1
CustomLog /absolute/path/to/app/subapp2/log/access_log common env=subapp2
Clerical answered 22/9, 2009 at 15:30 Comment(1)
I've not had success with this answer ... my question is here: https://mcmap.net/q/825006/-how-can-i-generate-seperate-logs-for-different-html-url-paths/32836Planet

© 2022 - 2024 — McMap. All rights reserved.