Giter VIP home page Giter VIP logo

mongodb_logger's Introduction

mongodb_logger's People

Contributors

andreykozlov1984 avatar burgalon avatar buszu avatar derfred avatar dimonzozo avatar jonasnielsen avatar kelevro avatar le0pard avatar leonid-shevtsov avatar maxtor avatar nick-desteffen avatar oleriesenberg avatar slm-linus avatar smostovoy avatar tmgemedia avatar vltsu avatar waldher avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mongodb_logger's Issues

You do not use capped collection for logs

I keep getting the message "You do not use capped collection for logs" on the mongodb webpage, but mongo says my collections are capped:

$ mongo
MongoDB shell version: 2.2.0
connecting to: test

use jigsaw
switched to db jigsaw
db.production_log.isCapped()
true

I am using 0.3.2

How to catch MOPED logs?

Hi! Is it possible to catch Moped logs?
I.e.:
MOPED: 127.0.0.1:27017 QUERY database=dating_development collection=users selector={"_id"=>"51d57961b3c480199"} flags=[] limit=0 skip=0 batch_size=nil fields={"last_action_at"=>1} (0.5791ms).
They are disappeared from stock logs and I've been expecting they would be shown at the mongodb_logger web interface. But there are no such messages. Could you please advice how to make them shown there?

NoMethodError at /mongodblogs/overview undefined method `merge!' for "index":String

assets are not loaded in staging and production

Although the gem works fine in development, the web interface in staging and production is rendered without the assets. Do I need to add the path to the asset precompile path? or should that be done automatically?

Having trouble with setup on Heroku

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?

Not working with moped 2.0 beta/beta2

Hi,
Once I update my project to moped 2.0 beta or beta2, no logs from mongodb_logger are recorded on my database, the collection I specified on my mongoid.yml for logger is created, but stays empty. No error messages.
As soon as I have a little more time, I'll try to investigate further.
Thanks
Jorge.

How to log message from Rails Console or Resque Jobs

I ran this command from console
Rails.logger.info "Test message from console"
but I cannot find that message on MongodbLogger, I only see that message was logged to log/development.log only

Is there any settings that enable log message to MongoDB from console?

Production logs not created when mongodb_logger can't connect

Hi all

When I use mongodb_logger in production and for whatever reason it cannot connect to mongo, I fail to get anything logged to my production.log.

I'm running the latest gem.

The error i get is:

MongodbLogger Initializer Error: Unable to access log file. Please ensure that /[Rails Root]/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.
Expected response 1 but got 3289390.

The log file is totally writeable, I have even tired recreating it. I just don't get any output to it.

Any thoughts?

Thanks

Stuart

Mongoid 5.1 support

Is anyone having issues with Mongoid 5.1?

Here is my setup. Rails 4.2.5.1 / Mongoid 5.1.1 / Mongo 2.4.14 / mongodb_logger 0.6.5. I see the development_log collection in my mongo DB but I get these errors trying to run rake mongodb_logger:* tasks.

MongodbLogger WARNING: Using Rails Logger due to exception: uninitialized constant Mongo::MongoClient

Also nothing actually gets logged into development_log collection.

Here is my config/mongodb_logger.yml
development:
database: rails425_dev
capsize: <%= 10.megabytes %>
host: localhost
port: 27017
replica_set: false

using mongodb_logger in any applications with one web interface

How about using mongodb_logger in any applications?

If I have any applications and want using standalone application with mongodb_logger to view logs.

Example:
app_1 (only logger)
app_2 (only logger)
app_3 (only logger)

MongoDBLogger:
app_4 (only web interface with switch between applications)

Log messages (debug/info/warn etc.) don't show up

Hello,

I have mongodb_logger generally working, except that it isn't capturing log messages. I have the following in my code:

logger.warn "Warning about something!"

But it does not get captured in the "messges => warn" hash. I have looked in the front end log view, as well as in the database itself.

Nothing shows up in log/development.log, so mondodb_logger is definitely picking something up. If I use:

puts "Warning about something!"

it shows up in my logfile.

superclass mismatch for class Binary when used with Mongoid 3.0 rc

This has been happening pre RC for Mongoid 3, but now that the RC is out I wanted to bring it up.

If I remove mongodb_logger from my app the error goes away. This gets thrown anytime the app is loaded/run.

Thoughts?

/Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bson-1.6.2/lib/bson/types/binary.rb:27:in <module:BSON>': superclass mismatch for class Binary (TypeError) from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bson-1.6.2/lib/bson/types/binary.rb:21:in<top (required)>'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in require' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:inblock in require'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in load_dependency' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:inrequire'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bson-1.6.2/lib/bson.rb:70:in <top (required)>' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:inrequire'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in block in require' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:inload_dependency'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in require' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/mongo-1.6.2/lib/mongo.rb:53:in<top (required)>'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:in require' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:inblock in require'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:236:in load_dependency' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/activesupport-3.2.3/lib/active_support/dependencies.rb:251:inrequire'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/mongodb_logger-0.2.8/lib/mongodb_logger.rb:3:in <top (required)>' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:inrequire'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/runtime.rb:68:in block (2 levels) in require' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:ineach'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/runtime.rb:66:in block in require' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:ineach'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler/runtime.rb:55:in require' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/bundler-1.1.4/lib/bundler.rb:119:inrequire'
from /Users/ghent/Code/Rails/lookingglass/config/application.rb:13:in <top (required)>' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:53:inrequire'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:53:in block in <top (required)>' from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:50:intap'
from /Users/ghent/.rvm/gems/ruby-1.9.3-p194/gems/railties-3.2.3/lib/rails/commands.rb:50:in <top (required)>' from script/rails:6:inrequire'
from script/rails:6:in `

'

Messages node is empty

Added mongodb_logger to existing application based on Rails 3.2.6. Everything seems working fine but messages node is empty for each logged messaged. Do you have any ideas, why it could happen?

Thanks.

Mongodb logger exception on server

I have mongodb logger working locally, but when I run it on my server I am getting an exception.

Sorry there was a nasty error. Maybe no connection to MongoDB. Debug: NoMethodError: undefined method `filter_by_conditions' for nil:NilClass>
{"SERVER_SOFTWARE"=>"Apache/2.2.22 (Ubuntu)", "SERVER_PROTOCOL"=>"HTTP/1.1"

My mongodb_logger.yml
development:
database: my_app_logs
capsize: <%= 1000.megabytes %>
host: localhost
port: 27017
replica_set: true

production:
database: my_app_prod_logs
capsize: <%= 1000.megabytes %>
host: localhost
port: 27017
replica_set: true

On my server I am running in production mode. I tried the rake task to precompile the assets, that ran successfully. Also have the capistrano task found in the readme in my deploy.rb. Any hints on how to debug/fix this? I'm using mongodb_logger (0.4.1)

Routing Errors not appearing in the logs

I am using version 0.4.2 in development and when I get a routing error in my application I see that no log entry is added to the mongodb database. Is this expected?

Can't add metadata to logs!

I'm trying to add some very basic data to the logs in my application controller (i.e. for all actions). I've put this in place (confirmed that the method is running) but nothing is showing up in Mongo DB!

before_filter :add_metadata_to_mongolog

....

  private

  def add_metadata_to_mongolog

    # make sure we're using the MongodbLogger in this environment
    if Rails.logger.respond_to?(:add_metadata)
      if current_user
        id = current_user.id
        email = current_user.email
      else
        id = nil
        email = nil
      end

      Rails.logger.add_metadata(:additional_data => {:user_id => id, :user_email => email, :logged_in => !email.nil?})
    end
  end

Consider reducing # of Rails versions you are running CI against

I see that mongodb_logger is being tested against every Rails 3.0.x and 3.1.x version ever released. While it is a nice idea to test against multiple versions, this means mongodb_logger takes 14-15 minutes for each build on travis-ci.org. Please consider only testing against 2 most recent 3.0.x and 3.1.x (and, eventually, 3.2.x) releases. You can still run tests against every Rails version out there locally, you can detect travis using ENV["CI"] being set.Thank you.

Filter what to log to MongoDB

Is it possible to filter what gets logged to MongoDB? I would like to only log messages with severity ERROR (exceptions).

Or only requests to specific routes. Or log different types of messages to different collections which can have different capped sizes / TTL indexes. This way I can keep certain types of messages longer than others.

Rails 5 support

As far as I can tell mongodb_logger should be able to support Rails 5 once Sinatra is Rails 5 compatible (issue here).

Meanwhile anyone coming across this can use:

# Gemfile
gem 'rack-protection', github: 'sinatra/rack-protection'
gem 'sinatra', github: 'sinatra/sinatra'
gem 'mongodb_logger',
  github: 'JonasNielsen/mongodb_logger',
  branch: 'rails-5'

That's necessary because sinatra is disabled in .gemspec

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.