Code Monkey home page Code Monkey logo

central_logger's People

Contributors

ahoward avatar alindeman avatar astupka avatar bowsersenior avatar chmurph2 avatar chris avatar demersus avatar tispratik 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  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

central_logger's Issues

Find db credentials in ENV[]

Is there a way to set the password now without including it in the source code?

How about a way to set authentication credentials through environmental variables?

Handle missing credentials during `rake assets:precompile`

Heroku runs rake assets:precompile without the env config vars of the application. If you keep your MongoDB credentials in config vars instead of your source tree (as it best practice) then the credentials won't be available to Central Logger during this rake task.

That would be fine, because who needs the logger during assets:precompile, but currently it throws an error:

** Execute assets:precompile
CentralLogger Initializer Error: Unable to access log file. Please ensure that [...]/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.
Failed to connect to a master node at dbh00.mongolab.com:27007
[…]/gems/mongo-1.3.1/lib/mongo/connection.rb:518:in `connect'
[…]/gems/mongo-1.3.1/lib/mongo/connection.rb:656:in `setup'
[…]/gems/mongo-1.3.1/lib/mongo/connection.rb:101:in `initialize'
[…]/bundler/gems/central_logger-d8e13e71b6ee/lib/central_logger/mongo_logger.rb:146:in `new'
[…]/bundler/gems/central_logger-d8e13e71b6ee/lib/central_logger/mongo_logger.rb:146:in `connect'
[…]/bundler/gems/central_logger-d8e13e71b6ee/lib/central_logger/mongo_logger.rb:95:in `internal_initialize'
[…]/bundler/gems/central_logger-d8e13e71b6ee/lib/central_logger/mongo_logger.rb:22:in `initialize'
[…]/bundler/gems/central_logger-d8e13e71b6ee/lib/central_logger/initializer_mixin.rb:6:in `new'
[…]/bundler/gems/central_logger-d8e13e71b6ee/lib/central_logger/initializer_mixin.rb:6:in `create_logger'
[…]/bundler/gems/central_logger-d8e13e71b6ee/lib/central_logger/railtie.rb:11:in `block in <class:Railtie>'
[…]/gems/railties-3.1.0/lib/rails/initializable.rb:25:in `instance_exec'

The Rails 3.1 on Cedar docs say to handle this case in the initializer. What's the best way to accomplish this in CL?

I stopped CentralLogger:Filter in application.rb but it didn't help:

include CentralLogger::Filter if ! (Rails.env == 'test' or File.basename($0) == "rake")

Is there anyway to do this outside of hacking CL? If not, what's the best way to update CL to handle this use case?

mongo is dead. love live moped.

mongoid is the top ODM for use in rails' projects attm, and it's dropping support for the mongo drive in lieu of moped

https://github.com/mongoid/moped

most importantly 'mongo' and 'moped' cannot co-exist in the same codebase to people using mongoid will soon not be able to use central_logger in rails' projects.

there seems to be two main ways forward

  1. factor out a driver layer in the code (if defined?(Mongo) AND if defined?(Moped))

  2. drop mongo support entirely and move to moved.

thoughts?

NoMethodError: undefined method `write' for nil:NilClass

NoMethodError: undefined method `write' for nil:NilClass
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/whiny_nil.rb:48:in `method_missing'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/buffered_logger.rb:109:in `block (2 levels) in     flush'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/buffered_logger.rb:108:in `each'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/buffered_logger.rb:108:in `block in flush'
<internal:prelude>:10:in `synchronize'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/buffered_logger.rb:107:in `flush'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/buffered_logger.rb:126:in `auto_flush'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/buffered_logger.rb:72:in `add'
/usr/local/rvm/gems/ruby-1.9.3-p0/bundler/gems/central_logger-1204fb4aba4d/lib/central_logger/mongo_logger.rb:41:in `add'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0/lib/active_support/buffered_logger.rb:83:in `debug'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid/logger.rb:7:in `debug'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongo-1.3.0/lib/mongo/connection.rb:627:in `setup'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongo-1.3.0/lib/mongo/connection.rb:101:in `initialize'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongo-1.3.0/lib/mongo/connection.rb:152:in `new'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongo-1.3.0/lib/mongo/connection.rb:152:in `from_uri'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid/config/database.rb:89:in `master'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid/config/database.rb:22:in `configure'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid/config.rb:317:in `configure_databases'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid/config.rb:120:in `from_hash'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid/config.rb:137:in `load!'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid.rb:145:in `load!'
/usr/local/rvm/gems/ruby-1.9.3-p0/gems/mongoid-2.2.0/lib/mongoid/railtie.rb:63:in `block in <class:Railtie>'

Collection Dropped and Re-Added on Site Error

This might have something to do with how I'm initializing things, but I'm finding a problem that in some cases - when the site actually throws an error seems to be one of them - where the mongodb collection is dropped and re-added. At least, I'm losing all previous log entries, so that's my assumption.

I'm currently initializing CentralLogger within the environment/.rb files, not the larger environment.rb initializer, due to some log related settings being set within the environment specific initializers. This might be related to the problem, though offhand I can't figure out how.

I'm assuming some condition is resulting in reset_collection being invoked. Any thoughts on what? Is this a problem with how/when I'm calling initialize_deprecated_logger, or is this a known issue? I imagine if it's related to the rails2 version and it is a problem, you're not in any rush to fix it, but if I knew what caused this to happen I could work around it on my end.

Thanks!

Help setting up different db for logging

Hi,
I am currently building the app with Mongoid. It seems that central-logger logs the data in default mongoid database, But i wanted to use different database for logging. How can i do this.?

Cheers

Feature Request - Ability to encrypt log messages

Hello, Thank you for the awesome gem. I feel if we can have the ability to encrypt/decrypt log messages being sent over the network to the mongo db instance it would be more awesome. I guess this can be done by using PKI.

undefined method `mongo_connection` for Log4r

Does central logger have support for log4r?

ruby-1.8.7-p352 :001 > db = Rails.logger.mongo_connection
NoMethodError: undefined method `mongo_connection' for #<Log4r::Logger:0x105092850>

Jmeter Perf Test shows central logger slows down requests

I did a Jmeter performance test for my application home page with and without central logger. The avg response time without central_logger is 800 ms and with central logger is 1100 ms. There is a jump of about 38 %.

Can we do something about it?

With Central Logger:

sampler_label,aggregate_report_count,average,aggregate_report_min,aggregate_report_max,aggregate_report_stddev,aggregate_report_error%,aggregate_report_rate,aggregate_report_bandwidth,average_bytes
HTTP Request,8990,1072,358,5383,371.13,0.0,8.30,167.55,20647.0
TOTAL,8990,1072,358,5383,371.13,0.0,8.30,167.55,20647.0

Without Central Logger:

sampler_label,aggregate_report_count,average,aggregate_report_min,aggregate_report_max,aggregate_report_stddev,aggregate_report_error%,aggregate_report_rate,aggregate_report_bandwidth,average_bytes
HTTP Request,9233,779,14,19128,435.53,0.00,12.23,246.1043213175322,20597.57
TOTAL,9233,779,14,19128,435.53,0.00,12.23,246.1043213175322,20597.57

`add': undefined method `<=' for nil:NilClass (NoMethodError)

I get following error when I run any scaffold or create model.

I am using rails 3.2.6 and ruby 1.9.3 also central_logger from master branch

/home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/bundler/gems/central_logger-72bba43d1990/lib/central_logger/mongo_logger.rb:46:in `add': undefined method `<=' for nil:NilClass (NoMethodError)
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/buffered_logger.rb:90:in `info'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activerecord-3.2.6/lib/active_record/railtie.rb:80:in `block (2 levels) in <class:Railtie>'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `each'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/lazy_load_hooks.rb:42:in `run_load_hooks'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activerecord-3.2.6/lib/active_record/base.rb:721:in `<top (required)>'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/railties-3.2.6/lib/rails/generators/named_base.rb:166:in `pluralize_table_names?'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/railties-3.2.6/lib/rails/generators/named_base.rb:114:in `table_name'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activerecord-3.2.6/lib/rails/generators/active_record/model/model_generator.rb:17:in `create_migration_file'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:109:in `invoke'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/group.rb:281:in `block in _invoke_for_class_method'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/shell.rb:74:in `with_padding'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/group.rb:270:in `_invoke_for_class_method'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/group.rb:150:in `_invoke_from_option_orm'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/task.rb:27:in `run'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:120:in `invoke_task'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `block in invoke_all'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `each'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `map'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/invocation.rb:126:in `invoke_all'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/group.rb:238:in `dispatch'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/thor-0.16.0/lib/thor/base.rb:425:in `start'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/railties-3.2.6/lib/rails/generators.rb:171:in `invoke'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/railties-3.2.6/lib/rails/commands/generate.rb:12:in `<top (required)>'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `block in require'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:251:in `require'
    from /home/pritesh/.rvm/gems/ruby-1.9.3-p194@rinema/gems/railties-3.2.6/lib/rails/commands.rb:29:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

logging stopped working on heroku

Works just fine locally including in production environment to production logs. No code or gem changes on our end, no relevant Heroku changes we are aware of. Any ideas?

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.