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? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
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. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---