Hi All I am using Rails default logger in my application. Is it possible to change the log level of the app dynamically i.e without restarting the server ? Thanks in advance Neeti --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Aug 24, 6:05 am, nr <neeti...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All > > I am using Rails default logger in my application. > > Is it possible to change the log level of the app dynamically i.e > without restarting the server ? >Have you tried just setting RAILS_DEFAULT_LOGGER.log_level ? Fred --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Fred Apologies for the late reply... I did try to change RAILS_DEFAULT_LOGGER.level by changing - 1. in environment.rb 2. Via ruby script\console But the changed log level does not come in effect. Logging keeps happening at the level defined during webrick startup. Thanks in advance -Neeti On Aug 24, 2:18 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Aug 24, 6:05 am,nr<neeti...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All > > > I am using Rails default logger in my application. > > > Is it possible to change the log level of the app dynamically i.e > > without restarting the server ? > > Have you tried just setting RAILS_DEFAULT_LOGGER.log_level ? > > Fred--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 2 Sep 2008, at 13:46, nr wrote:> > Hi Fred > > Apologies for the late reply... > > I did try to change RAILS_DEFAULT_LOGGER.level by changing - > 1. in environment.rb > 2. Via ruby script\console > > But the changed log level does not come in effect. > Logging keeps happening at the level defined during webrick startup. >It sounds like you''ve got your server running and then you played around with script/console and tried editing environment.rb. That definitely won''t work. To have a snowball''s change in hell, code running inside your app would have to set RAILS_DEFAULT_LOGGER.level Fred> Thanks in advance > -Neeti > > > > On Aug 24, 2:18 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: >> On Aug 24, 6:05 am,nr<neeti...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All >> >>> I am using Rails default logger in my application. >> >>> Is it possible to change the log level of the app dynamically i.e >>> without restarting the server ? >> >> Have you tried just setting RAILS_DEFAULT_LOGGER.log_level ? >> >> Fred > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Now I tried to change RAILS_DEFAULT_LOGGER.level through controller action initiated by a form submit. Got the following exception (posted in pastie) related to webrick/ httputils - http://pastie.org/265086 After this error, the webrick stops rendering the screens and gives the "Not Found " status on the browser. [Restarting webrick brings it back to action] On Sep 2, 5:48 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 2 Sep 2008, at 13:46, nr wrote: > > > > > Hi Fred > > > Apologies for the late reply... > > > I did try to change RAILS_DEFAULT_LOGGER.level by changing - > > 1. in environment.rb > > 2. Via ruby script\console > > > But the changed log level does not come in effect. > > Logging keeps happening at the level defined during webrick startup. > > It sounds like you''ve got your server running and then you played > around with script/console and tried editing environment.rb. That > definitely won''t work. To have a snowball''s change in hell, code > running inside your app would have to set RAILS_DEFAULT_LOGGER.level > > Fred > > > Thanks in advance > > -Neeti > > > On Aug 24, 2:18 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > >> On Aug 24, 6:05 am,nr<neeti...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi All > > >>> I am using Rails default logger in my application. > > >>> Is it possible to change the log level of the app dynamically i.e > >>> without restarting the server ? > > >> Have you tried just setting RAILS_DEFAULT_LOGGER.log_level ? > > >> Fred--~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---