No commit activity in last 3 years
No release in over 3 years
A logging device for the lumberjack gem that writes log entries to a MongoDB collection.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 1.1.5
 Project Readme

Lumberjack Mongo Device¶ ↑

This gem is no longer being maintained. It only works with lumberjack 1.x and mongo 1.x gems¶ ↑

This gem provides a logging device for the lumberjack gem that will log to a MongoDB collection.

MongoDB can make a good destination for centralized log data because it is fast, clients don’t need to wait for confirmation that log messages are persisted, and it has a concept of capped collections which are fixed in size and will simply roll over and start writing from the beginning when they are full.

Example Usage¶ ↑

require 'lumberjack_mongo_device'

# Connect to mongodb on localhost:27017 and use the "log" collection in the "app" database.
# The log collection will be created as a capped collection with a maximum size of 1GB.
device = Lumberjack::MongoDevice.new(:db => "app", :collection => "log", :size => 1024 ** 3)
logger = Lumberjack::Logger.new(device)
logger.info("Write me to MongoDB!")

See MongoDevice for more details.