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 Getting started with Flex and Zend_Amf

DevShed: Introducing the Memento Pattern

Dutch Web Alliance: Using Varnish with ESI for a REST API Build Blazing Fast PHP Websites with Memcached Distributed Caching

9Lessons: Import GMail Contacts Google OAuth Connect with PHP

Community Events

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

php7 series language laravel community opinion introduction list framework library voicesoftheelephpant unittest api interview example podcast release extension laravel5 version

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