Apache Logging one result in wrong access.log file -
i've created multiple customlog files(created logs different websites), via vhost.conf aren't being logged in access.log
from there i've taken 1 step further isolate folder, on website, , log information separately usage can tracked.
the code; few setenvif request_uri's removed (like 1 css , js) easier reading.
<virtualhost *:80> serveradmin support@domain.com documentroot "/var/www/domain.com" servername domain.com serveralias www.domain.com errorlog "/var/www/domain_apache_error.log" ## flag image requests setenvif request_uri "(\.gif|\.png|\.jpg)$" image-request=nolog ## flag folder calls setenvif request_uri "^/folder/" folder-request=nolog ## set do_not_log if of above flags set setenvif image-request nolog do_not_log setenvif folder-request nolog do_not_log ## log if do_not_log not set customlog "/var/www/domain_folder_access.log" common env=folder-request customlog "/var/www/domain_access.log" common env=!do_not_log </virtualhost>
all works great, 1 exception. appear though 1 particular result cached , still being logged in access.log file.
example:
/folder/12/file-name.php /folder/13/file-name.php /folder/14/file-name.php /folder/15/file-name.php /folder/17/file-name.php
are being logged, should, in domain_folder_access.log
/folder/16/file-name.php
is still appearing in access.log
so,.. i'm using apache, windows/wamp. , appear though /folder/16/file-name.php somehow 'cached' , being logged in wrong file. process clear information file gets logged properly. (i've tried restarting) , again else working should.
after watching access.log, , seeing 'few' other files being logged in access.log file, came realization files being logged coming secure version of site. i.e. https vs http
updating in config/extra/httpd-ssl.conf file use same setenvif structure corrected issue.
..a fyi else might experience same issue.
Comments
Post a Comment