Excluding an action from the log?

I have an ajax function that runs every 2 seconds on my site. As you can
imagine this creates quite lengthy logs.

Is there any way to exclude just this particular action from creating
entries in the production log?

Hello Jason,

I have an ajax function that runs every 2 seconds on my site. As
you can imagine this creates quite lengthy logs.

Is there any way to exclude just this particular action from creating
entries in the production log?

In your action foo, you can write either :

def foo
self.class.silence do
# do sth
end
end

or :

def foo
logger.silence do
# do sth
end
end

the latter is the nicer.

РJean-Fran̤ois.


Ã? la renverse.

I’m having the same issue and I tried both approaches:

def clock
self.class.silence do
render :text => DateTime.now.strftime("%H:%M")
end
end

and

def clock
logger.silence do
render :text => DateTime.now.strftime("%H:%M")
end
end

but is not working.

Maybe I didn’t get how to do it. Could some one lend my a hand?

Thx

Fernando