My name is Oleksii Vasyliev.
I work as a Software Engineer. For more information about me, check out this links:
MongoDB logger for Rails
Home Page: http://mongodb-logger.catware.org/
License: MIT License
My name is Oleksii Vasyliev.
I work as a Software Engineer. For more information about me, check out this links:
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
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?
I as a user want to be able see my IP in logger list as "you"
It have:
Make wide of this section to left side of sidebar
Design: http://min.us/mP5cgCBbw
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?
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?
https://skitch.com/pojitonov/gem1x/mongodb-logger
'messages' : {
'info' : [ ],
'debug' : [ ],
'error' : [ ],
'warn' : [ ],
'fatal' : [ ]
}
Design Source: http://min.us/muYF3E3PX
Hi, I have a question which I wrote in the title.
Is it possible? If so, how can I do that?
Could you ask me please?
Thank you.
Please don't do this. Just setup a method to filter your own data, don't globally screw with everyone else.
info: http://yokolet.blogspot.com/2009/07/design-and-implementation-of-ruby-m17n.html
The moped adapter (moped.rb) uses ::BSON::ObjectId, but Mongoid/Moped has changed this to Moped::BSON::ObjectId (see http://mongoid.org/en/mongoid/docs/upgrading.html and mongoid/mongoid@fab5cc8). Applications using the Mongoid Gem hit the exception:
uninitialized constant BSON
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.
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?
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
I'd like to save the url of the mongo log collection each time I hit a particular error condition, is there a way to get access to the _id to generate a url with? Or is the actual log not generated until after you exit the controller action?
Ruby 2 Rails 3
cannot load such file -- mongodb_logger/server (LoadError)
Screenshot: http://www.webpagescreenshot.info/img/5378754679c447-96121680
I have my capsize set to 100mb on production, and I tried to deploy a new version with 500mb, but it does not seem to take (the webpage front end still says 100mb). Do you need to delete and recreate your mongo database or something to get a larger capacity?
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
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)
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.
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: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:in load_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/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:in
require'
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:in
load_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: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:in load_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/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:in
require'
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:in
each'
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:in
each'
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:in
require'
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:in
require'
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:in
tap'
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:in
require'
from script/rails:6:in `
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.
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)
I as a user want to be albe see current location from some log by user IP.
As link on google map
Make List Header and sidebar fixed on scrolling line on Gmail
https://skitch.com/pojitonov/gm87u/gmail-bin-pojitonov-gmail.com
In our case we can fix sidebar and headers of table with filter https://skitch.com/pojitonov/gm874/00000002
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?
Error bullets is shifted https://skitch.com/pojitonov/gj2xq/mongodb-logger
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
I decided to launch yours logger, but at my project i use spreecommerce connected to main app like rails engine.
And in logs i see actions only from main app, not from Spree::Core engine.
Thanks.
If collection size is changed in config the only way to apply it now is manual. I see tests already recreate it so just create a rake task and maybe capistrano task would be helpful.
In list we can display only time or some shooter format
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.
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.