Welcome! Log In Create A New Profile

Advanced

Re: how to separate robot access log and human access log

Francis Daly
April 30, 2015 01:46PM
On Mon, Apr 27, 2015 at 07:45:17PM -0400, meteor8488 wrote:

Hi there,

> I'm trying to separate the robot access log and human access log, so I'm
> using below configuration:

"if=" on the access_log line is what you want.

> access_log /web/log/location_access.log main;

"No 'if=' there" means "log all requests to this file". (Unless overridden
later.)

> access_log /web/log/spider_access.log main if=$spiderbot;
> access_log /web/log/rssbot_access.log main if=$rssbot;
>
> But it seems that nginx still writes some robot logs in to both
> location_access.log and spider_access.log.

Do you mean "some" or "all"?

> How can I separate the logs for the robot?

If you want /web/log/location_access.log to only log some requests,
add an "if=" to mark the requests that you want logged.

> And another questions is that some robot logs are not written to
> spider_access.log but exist in location_access.log. It seems that my map is
> not working. Is anything wrong when I define "map"?

Example?

Anything written to /web/log/rssbot_access.log would match that
description, but I guess that's not what you mean.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

how to separate robot access log and human access log

meteor8488 April 27, 2015 07:45PM

Re: how to separate robot access log and human access log

Francis Daly April 30, 2015 01:46PM

Re: how to separate robot access log and human access log

meteor8488 May 05, 2015 08:20AM

Re: how to separate robot access log and human access log

Francis Daly May 05, 2015 01:50PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 204
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready