Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

no logging in production mode?

#3038

I ran Altered Beast on Rails 3 and noticed it didn't seem to log at all. I'm not sure why that is... maybe some new config setting is needed now?

Reported by Rick · August 12th, 2009 @ 06:32 AM

State: resolved
Milestone: 3.0.2
Assigned to: nobody
Importance: none

Activity

  1. Elise Huard
  2. James A Rosen
    James A Rosen

    I do seem to get logging for going to a page that doesn't exist. Try going to /pathThatDoesNotExist. I get

    Rendered /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)

    January 16th, 2010 @ 04:05 PM

  3. Rizwan Reza
    Rizwan Reza
    • Tag set to review

    Logging is being populated as it should in log/production.log.

    January 16th, 2010 @ 06:06 PM

  4. Jeremy Kemper
    Jeremy Kemper
    • State changed from new to resolved

    January 16th, 2010 @ 08:04 PM

  5. Ben Mishkin
    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_SIZE
    

    so 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.

    January 24th, 2010 @ 03:45 PM

  6. Jeremy Kemper
    Jeremy Kemper
    • Milestone set to 3.0.2
    • Importance changed from to

    October 15th, 2010 @ 11:01 PM