how to separate robot access log and human access log

Francis Daly francis at daoine.org
Tue May 5 17:48:13 UTC 2015


On Tue, May 05, 2015 at 08:20:35AM -0400, meteor8488 wrote:

Hi there,

> if $spiderbot=0, then log to location_access.log

Set a variable which is non-zero when $spiderbot=0, and which is zero
or blank otherwise. Use that as the access_log if=$variable for
location_access.log.

> if $spiderbot=1, then log to spider_access.log.

Set a variable which is non-zero when $spiderbot=1, and which is zero
or blank otherwise. ($spiderbot is probably perfect for this as-is.) Use
that as the access_log if=$variable for spider_access.log.

> And I don't want the same logs write to different files.

For each loggable request, make sure that exactly one of your if=$variable
variables is non-zero.

	f
-- 
Francis Daly        francis at daoine.org



More information about the nginx mailing list