Peter Marklund

Peter Marklund's Home

Fri October 29, 2010
Programming

Request Log - RubyGem for Logging Rack (Rails) Web Requests to MongoDB

Prompted by the fact that Heroku doesn't keep the Rails request logs around I went out looking for a logging solution. What I've ended up with is Request Log - a simple RubyGem for logging web requests to MongoDB.

My experiences with logging to MongoDB so far have been very positive. I see big potential in logging web requests to a database. The reason MongoDB is so well suited for the task is its high performance and strong query capabilities. This allows you to do advanced queries such as "give me all requests in this time period, with this response, status, this execution time, these parameters etc.". Each web request becomes a document in MongoDB and if you choose your database fields wisely you have a great tool at your disposal for statistics, monitoring, and debugging etc.

I'm curious to see how we'll be able to design and use our web request logs in the project I'm currently in. I'll report back here any interesting findings that we make.

Comments

grimen said over 4 years ago:

Sweet, I needed something like this after a night of frustration with missing fundamental pieces in Heroku for debugging the system. Thanks!

--------------------------------------------------------------------------------