No commit activity in last 3 years
No release in over 3 years
This allows many applications to log to a shared mongodb logger. It is useful, if you have many small applications / load balanced applications and you want to treat a log as a first class citizen.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

Winston Mongodb Rails

Initial alpha release, still tied to a rails application config. There are no test, and some tight coupling deep in the code. This is an internal tool in the early stages of open source Hopefully this should be improved in later releases.

Installation

Add the gem to your Gemfile

gem 'winston_mongodb_rails'

Add config/initializers/mongo_logger.rb

app_config = Rails.application.config
Mog = WinstonMongodbRails::MongoLogger.create_logger(app_config, ((app_config.paths.log.to_a rescue nil) || app_config.paths['log']).first)

For mongo configuration, you need to add the configuration of the mongodb database to config/mongo_logger.yml, config/mongoid.yml or config/database.yml

production:
  username: username
  password: password
  database: logs
  replicaset: ['10.10.10.2:27017', '10.10.10.1:27017']
  replicaset_name: 'replicaset_name'
  
development:
  username: username 
  password: password
  database: logs
  host: localhost

Usage

Mog.error "This is an error", object_to_inspect
Mog.debug "Debug message"
Mog.info "Info message"