News Feed

News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way
Error Logging with MongoDB and Analog
March 22, 2012 @ 11:11:39

On today there's a new tutorial from Lorna Mitchell introducing you to using Analog for error logging in a MongoDb connection. Because of the way the tool (Analog) is designed, it could be used anywhere - she just uses the MongoDB connection as an example because it integrates easily and efficiently.

MongoDB is an excellent fit for logging (and of course other things as well) for many reasons. For one, it is very VERY fast for writing data. It can perform writes asynchronously; your application wont hang because your logging routines are blocked. This allows you to centralize your logs which makes it easier to querying against them to find issues. Also, its query interface is easy to work with and is very flexible. You can query against any of the field names or perform aggregate functions either with map/reduce or MongoDB 2.2's upcoming aggregation framework.

This article will show how you can use existing code to add a logging library to your code and log errors to MongoDB. You'll also see how to query MongoDB from the command line and how to filter those queries to find the information you are interested in.

Analog makes it simple to log information in an easy to use, self-contained, extensible kind of way, offering writers for multiple output formats including: files, the FirePHP plugin output, email, POSTing to another machine and sending to a syslog daemon. She also mentions the different logging levels the tool makes available and how to filter down your logging results based on them (searched by "equal to", "greater than" and grouped by level).

0 comments voice your opinion now!
error logging mongodb analog document database tutorial

blog comments powered by Disqus

Similar Posts

DevShed: Building an Image Generator Class with PHP 5

SitePoint PHP Blog: How to Deploy Symfony Apps with Capifony

SitePoint PHP Blog: The real difference between PHP and Python Increase Productivity by Creating PHP Helper Functions Creating RSS Feeds with the Zend Framework for Fun and Profit

Community Events

Don't see your event here?
Let us know!

community package library tips deployment laravel series interview zendserver introduction opinion symfony language update podcast release api install list framework

All content copyright, 2014 :: - Powered by the Solar PHP Framework