This project is archived and is in readonly mode.

#3038 ✓resolved
Rick

no logging in production mode?

Reported by Rick | August 12th, 2009 @ 06:32 AM | in 3.0.2

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?

Comments and changes to this ticket

  • Elise Huard
  • James A Rosen

    James A Rosen January 16th, 2010 @ 04:05 PM

    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)

  • Rizwan Reza

    Rizwan Reza January 16th, 2010 @ 06:06 PM

    • Tag set to review

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

  • Jeremy Kemper

    Jeremy Kemper January 16th, 2010 @ 08:04 PM

    • State changed from “new” to “resolved”
  • Ben Mishkin

    Ben Mishkin January 24th, 2010 @ 03:45 PM

    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.

  • Jeremy Kemper

    Jeremy Kemper October 15th, 2010 @ 11:01 PM

    • Milestone set to 3.0.2
    • Importance changed from “” to “”

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Tags

Pages