ActiveSupport 3.2.0 logging exception #4683

Closed
wtn opened this Issue Jan 26, 2012 · 6 comments

Comments

Projects
None yet
3 participants

wtn commented Jan 26, 2012

In my console, I see the following error each time an exception gets raised in my application:

Could not log "process_action.action_controller" event. ArgumentError: wrong number of arguments (1 for 0)

The message originates from the log_subscriber.rb source file:

def call(message, *args)
  return unless logger

  method = message.split('.').first
  begin
    send(method, ActiveSupport::Notifications::Event.new(message, *args))
  rescue Exception => e
    logger.error "Could not log #{message.inspect} event. #{e.class}: #{e.message}"
  end
end

I am starting with a freshly generated Rails 3.2 application. I haven't changed any logger settings.

Owner

rafaelfranca commented Jan 26, 2012

Could you provide an example application?

Owner

rafaelfranca commented Jan 26, 2012

I didn't could reproduce it.

With a freshly application:

=> Booting WEBrick
=> Rails 3.2.0 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2012-01-26 11:58:28] INFO  WEBrick 1.3.1
[2012-01-26 11:58:28] INFO  ruby 1.9.3 (2011-10-30) [x86_64-darwin11.2.0]
[2012-01-26 11:58:28] INFO  WEBrick::HTTPServer#start: pid=30395 port=3000


Started GET "/articles" for 127.0.0.1 at 2012-01-26 11:58:30 -0200
Processing by ArticlesController#index as HTML
  Article Load (0.1ms)  SELECT "articles".* FROM "articles" 
  Rendered articles/index.html.erb within layouts/application (20.5ms)
Completed 500 Internal Server Error in 151ms

ActionView::Template::Error ():
    1: <h1>Listing articles</h1>
    2: <% raise -%>
    3: 
    4: <table>
    5:   <tr>
  app/views/articles/index.html.erb:2:in `_app_views_articles_index_html_erb__3289415240800444329_70128599177540'
  app/controllers/articles_controller.rb:7:in `index'


  Rendered vendor/ruby/1.9.1/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (4.2ms)
  Rendered vendor/ruby/1.9.1/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (0.9ms)
  Rendered vendor/ruby/1.9.1/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/template_error.erb within rescues/layout (7.2ms)

wtn commented Jan 26, 2012

ok thanks—

I'm having trouble reproducing outside my app. I'll reopen if I can track this down to a legit problem.

wtn closed this Jan 26, 2012

Contributor

henrik commented Jan 30, 2012

Seeing this in our app as well. Will comment again if I figure out why.

Contributor

henrik commented Jan 30, 2012

The problem is with will_paginate. It's fixed in this fork: https://github.com/larspind/will_paginate (this commit: calvincorreli/will_paginate@87c7955)

Pull request here: mislav/will_paginate#215

wtn commented Jan 30, 2012

@henrik Thanks for reporting your findings. I will follow the will_paginate pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment