le0pard/mongodb_logger

Having trouble with setup on Heroku

Closed this issue · 5 comments

The gem is working on my local machine. However, when I go to run it in Heroku with:

production:
  uri: <%= ENV['MONGOHQ_URL'] %>

staging:
  uri: <%= ENV['MONGOHQ_URL'] %>

I get the following:

Sorry there was a nasty error. Maybe no connection to MongoDB. Debug: #<NoMethodError: undefined method `find' for nil:NilClass><br />{"REMOTE_ADDR"=>"10.84.53.53", "REQUEST_METHOD"=>"GET", "REQUEST_PATH"=>"/app/admin/mongodb/overview", "PATH_INFO"=>"/overview", "REQUEST_URI"=>"/app/admin/mongodb/overview", "SERVER_PROTOCOL"=>"HTTP/1.1", "HTTP_VERSION"=>"HTTP/1.1", "HTTP_X_FORWARDED_PROTO"=>"https", "HTTP_X_FORWARDED_PORT"=>"443", "HTTP_X_FORWARDED_FOR"=>"68.146.223.243", "HTTP_USER_AGENT"=>"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.43 Safari/536.11"

.......

Do I have to have mongoid or mongo_mapper installed for this to work?

Never mind, got it working...

MongodbLogger doesn't understand url parameter. You can create issue for this feature.

Support to url parameter add to master branch.

Thanks for the reply. Yes - I did get it working by NOT using the URI connection parameter. I connected via host/port instead. (I had URI in there originally because I had central_logger working that way - I think).

No, central_logger not working with url parameter also. But for now mongodb_logger can use such parameter. Just edit in gem file mongodb_logger to this:

gem 'mongodb_logger', :git => 'git://github.com/le0pard/mongodb_logger.git', :branch => 'master'