Setting config.logger in environment.rb has no effect when starting a server with script/server and mongrel. Using “script/server webrick”, or “mongrel_rails start” does work.
I think this is caused by code in the mongrel.rb file that script/server uses which loads just the logging environment (but not my environment) in order to figure out which log file to tail
railties/lib/server/mongrel.rb:
require 'initializer'
Rails::Initializer.run(:initialize_logger)
Loading the environment here causes the RAILS_DEFAULT_LOGGER constant to get set, and thus when my config finally gets loaded when mongrel itself starts up, the config.logger I set gets ignored as the rails init code does nothing if RAILS_DEFAULT_LOGGER is set:
railties/lib/initializer.rb:
def initialize_logger
# if the environment has explicitly defined a logger, use it
return if defined?(RAILS_DEFAULT_LOGGER)
...
end