I’m running Rails 1.2.3 with mongrel and Ruby 1.8.6 on Windows.
I change the log_level in environment.rb from :debug to :warn
(or :error) but still see gobs of output in the development.log file.
The log_level setting seems to have no effect for me. I also tried
putting in config.log_level = :warn in the environments/development.rb
file to no avail.
I did restart the server each time after making and saving the edits
to the file.
More than discovering a fix to my problem, I’d greatly appreciate any
pointers as to how to go about debugging this issue.
Okay it looks like RAILS_DEFAULT_LOGGER is set so the log_level
settings in the config files are ignored. Can’t seem to find who may
be setting the RAILS_DEFAULT_LOGGER. Will appreciate any pointers.
putting in config.log_level = :warn in the environments/development.rb
file to no avail.
I did restart the server each time after making and saving the edits
to the file.
More than discovering a fix to my problem, I’d greatly appreciate any
pointers as to how to go about debugging this issue.
Thanks
Vish
I believe there’s a bug in script/server when used with Mongrel related
to this issue. Try searching the bugtracker at dev.rubyonrails.org for
more information.
It seems that the offending line (that causes the logging settings in
the config files to be skipped) is
Rails::Initializer.run(:initialize_logger)
in rails-1.2.3/lib/commands/servers/mongrel.rb. This is line #50 for
me. Due to this the RAILS_DEFAULT_LOGGER is set and you have to put a
setting like this in the config file:
I seem to recall that you might be able to dodge the issue by using
“mongrel_rails start” instead of script/server. My memory has been known
to be corrupted though
–
Cheers,
Jacob A.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.