Skip to content
This repository

undefined method `logger=' for Mongoid::Config:Module #2221

Closed
MadRabbit opened this Issue July 21, 2012 · 1 comment

2 participants

Nikolay Nemshilov Durran Jordan
Nikolay Nemshilov

Hey folks, could yo please look up what's up with the version 3.0.1 ? it crashes when an app tries to access the mongoid logger

/Users/nikolay/workspace/work/theosom/config/application.rb:57:in `<class:Application>': undefined method `logger=' for Mongoid::Config:Module (NoMethodError)
    from /Users/nikolay/workspace/work/theosom/config/application.rb:20:in `<module:TheOsom>'
    from /Users/nikolay/workspace/work/theosom/config/application.rb:19:in `<top (required)>'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/nikolay/workspace/work/theosom/config/environment.rb:2:in `<top (required)>'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/nikolay/workspace/work/theosom/spec/spec_helper.rb:3:in `<top (required)>'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /Users/nikolay/workspace/work/theosom/spec/models/image_spec.rb:1:in `<top (required)>'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `block in load_spec_files'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `map'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/configuration.rb:780:in `load_spec_files'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/command_line.rb:22:in `run'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:69:in `run'
    from /Users/nikolay/.rbenv/versions/1.9.3-p194/lib/ruby/gems/1.9.1/gems/rspec-core-2.11.1/lib/rspec/core/runner.rb:8:in `block in autorun'

It all worked nicely on latest 2.x versions

Thanks

Durran Jordan durran referenced this issue from a commit in mongoid/mongoid-site July 22, 2012
Durran Jordan Add note on setting different logger. [ mongoid/mongoid#2221 ] 61cb8e0
Durran Jordan durran referenced this issue from a commit in mongoid/mongoid.github.com July 22, 2012
Durran Jordan Add note on setting different logger. [ mongoid/mongoid#2221 ] eac28a4
Durran Jordan
Owner
durran commented July 22, 2012

The method was moved to the top level namespace:

Mongoid.logger = Logger.new($stdout)

As per semver, major release can have backwards incompatible changes. I made a note in the documentation regarding this.

Durran Jordan durran closed this July 22, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.