This project is archived and is in readonly mode.
no logging in production mode?
-
Elise Huard
verified.
-
James A Rosen
I do seem to get logging for going to a page that doesn't exist. Try going to
/pathThatDoesNotExist. I getRendered /Users/me/projects/ruby/rails3/actionpack/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within /Users/me/projects/ruby/rails3/actionpack/lib/action_dispatch/middleware/templates/rescues/layout.erb (2.2ms)
-
Jeremy Kemper
- State changed from new to resolved
-
Ben Mishkin
I had the same issue. Turned out to be that Rails.logger.auto_flushing was set to 1000 by default in production mode, making it appear that it was nonfunctional:
$ script/console production New RightAws::Ec2 using single-threaded mode Loading production environment (Rails 3.0.pre) irb(main):001:0> Rails.logger => #<ActiveSupport::BufferedLogger:0xb7807c00 @auto_flushing=1000, @buffer={}, @level=0, @log=#<File:.../log/production.log>, @guard=#<Mutex:0xb77ff294>>This comes from railties/lib/rails/bootstrap.rb:70
logger.auto_flushing = false if Rails.env.production?and activesupport/lib/active_support/buffered_logger.rb:94
def auto_flushing=(period) @auto_flushing = case period ... when false, nil, 0; MAX_BUFFER_SIZEso then :
irb(main):004:0> Rails.logger.inspect => "#<ActiveSupport::BufferedLogger:0xb7807c00 @auto_flushing=1, @buffer={}, @level=0, @log=#<File:/home/deploy/wrangler/releases/20100124150359/log/production.log>, @guard=#<Mutex:0xb77ff294>>" irb(main):006:0> Rails.logger.auto_flushing=false => false irb(main):007:0> Rails.logger.inspect => "#<ActiveSupport::BufferedLogger:0xb7807c00 @auto_flushing=1000, @buffer={}, @level=0, @log=#<File:/home/deploy/wrangler/releases/20100124150359/log/production.log>, @guard=#<Mutex:0xb77ff294>>"Is this the intent, to disable auto_flushing and force developers to manually flush the rails log in production mode? I would have expected auto_flushing=1.