Change Log level at runtime

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

Have you tried just setting RAILS_DEFAULT_LOGGER.log_level ?

Fred

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

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

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]