PHP CURL causing Huge Apache access log -


i'm curious know how stop apache logging every url search curl.

my php script opens few hundred thousand urls, scans them, takes tiny bit of info, closes, , opens next.

i discovered after opening access log each , every url opened curl written access log.

::1 - - [01/dec/2010:18:37:37 -0600] "get /test.php http/1.1" 200 8469 "-"..." 

my access log 45mbytes large. anyone?

if of curl requests coming single or otherwise manageable group of ips can exclude them logs configuration similar following:

# set address here, can multiple addresses setenvif remote_addr "1\.1\.1\.1" mycurlrequest customlog logs/access_log common env=!mycurlrequest 

you can similar user agent field default indicate it's curl.

you can read more here: http://httpd.apache.org/docs/2.2/logs.html#accesslog (conditional logging last section under header) , here http://httpd.apache.org/docs/2.2/mod/mod_setenvif.html#setenvif

if want conditionally exclude logging precise method possible such ip address. in event server externally accessible don't want find not logging external requests curl.

using conditional logging can segment logging if want multiple files 1 of roll more frequently. benefit of can save space , @ same time have log data research , debug.


Comments

Popular posts from this blog

Add email recipient to all new Trac tickets -

400 Bad Request on Apache/PHP AddHandler wrapper -

php - Change action and image src url's with jQuery -