Take the 2-minute tour ×

I am using central_logger(0.3.3) gem for my rails app.

I follow each instruction as per documentation https://github.com/customink/central_logger.

record inserted successfully. But I want to fetch records of central_logger to show analysis in my app is there any way?

please help

share|improve this question
add comment

1 Answer

I was able to access the db and its records as per the documentation

db = Rails.logger.mongo_connection  #specifies db, NO Need to change anything use as is

collection = db[Rails.logger.mongo_collection_name] #specifies mongo collection, NO Need to change anything use as is.

cursor = collection.find(:action => 'show') #get all central_logger records with action show 

cursor.each do |obj|
  obj ## A single mongo  record object

Works for me...!

share|improve this answer
add comment

Your Answer


