News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

PHPMaster.com:
Error Logging with MongoDB and Analog
March 22, 2012 @ 11:11:39

On PHPMaster.com 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

JellyandCustard.com: Regular Expressions in PHP

HowTo Forge: Installing And Working With Xoops Under Ubuntu 6.10

Gregory Szorc's Blog: PHP Now Using Proper HTTP Status Codes on Error

Dean Clatworthy: Theming/styling error messages in Symfony 2

Zend Developer Zone: Paging Data Sets With PEAR Pager


Community Events





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


series community interview refactor unittest code release configure install symfony2 framework podcast opinion language developer introduction list laravel threedevsandamaybe testing

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework