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

The Bakery: Ten New Tutorials/Components/Releases Posted

Community News: Zend Releases Speaker List for ZendCon 2006 Setting Custom Error Messages for Zend_Form_Element

ParticleTree Blog: PHP Quick Profiler

Zend Developer Zone: Accepting Credit Card Payments with OXID eShop CE and AlertPay

Community Events

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

application yii2 configure php7 opinion api symfony community example part2 composer laravel introduction list series interview framework language podcast project

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