I would like to separate apache 2.2 log entries in 2 log files: requests from LAN (192.168.0.0/16) should go in a lan-access.log
, and the rest in the default access.log
How can I achieve that? I've tried to use SetEnvIf
and conditional logging as described in https://httpd.apache.org/docs/current/logs.html#conditional :
$ cat /etc/apache2/conf.d/lan-access-log.conf
SetEnvIf Remote_Addr "192\.168\." fromlan
CustomLog ${APACHE_LOG_DIR}/lan-access.log common env=fromlan
but it doesn't work and LAN requests keep popping up in the main acess.log
. What is wrong with my config?