Joel Nylund
2007-Jul-31 18:08 UTC
[Mongrel] anyway to exclude logging for a given IP address?
Hi, im not sure if this is a mongrel or rails question, so im sorry if I got the wrong list. Is there anyway to turn off logging (in production.log) if a request comes from a given IP address. I use monit to watch everything, and I get tons of this in my log file: Processing AccountController#login (for 127.0.0.1 at 2007-07-31 14:06:28) [GET] Session ID: XXXXXXXXXXXXXXXXXX Parameters: {"action"=>"login", "controller"=>"account"} Rendering layoutfalse within layouts/login Rendering account/login Completed in 0.00390 (256 reqs/sec) | Rendering: 0.00286 (73%) | DB: 0.00078 (19%) | 200 OK [http:// /] thanks Joel
Joey Geiger
2007-Jul-31 19:43 UTC
[Mongrel] anyway to exclude logging for a given IP address?
This is a rails question. The way I did it was to create a specific monit controller, that has a single action and define logger to be empty so it just does nothing, which keeps it from writing to the log file. Index just calls index.rhtml which just has the word "success" in it. Not sure if that or :render :text => "success" is faster, but either works. class MonitController < ActionController::Base session :off ## this is used by the monitoring scripts to see if the mongrel is up and running def index end def logger end end On 7/31/07, Joel Nylund <jnylund at yahoo.com> wrote:> Hi, im not sure if this is a mongrel or rails question, so im sorry > if I got the wrong list. > > Is there anyway to turn off logging (in production.log) if a request > comes from a given IP address. I use monit to watch everything, and I > get tons of this in my log file: > > Processing AccountController#login (for 127.0.0.1 at 2007-07-31 > 14:06:28) [GET] > Session ID: XXXXXXXXXXXXXXXXXX > Parameters: {"action"=>"login", "controller"=>"account"} > Rendering layoutfalse within layouts/login > Rendering account/login > Completed in 0.00390 (256 reqs/sec) | Rendering: 0.00286 (73%) | DB: > 0.00078 (19%) | 200 OK [http:// /] > > thanks > Joel > > _______________________________________________ > Mongrel-users mailing list > Mongrel-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/mongrel-users >