News Feed
Jobs 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

Jani Hartikainen's Blog: Decoupling models from the database: Data Access Object pattern in PHP

PHPMaster.com: Error Logging with MongoDB and Analog

Tizag.com: PHP HTML Form Example

DevShed: Intercepting Customized Exceptions in PHP 5

Elizabeth Smith's Blog: How to Compile PHP5.2 and PHP-GTK2 on Windows using Visual C++ Express


Community Events











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


symfony2 opinion database hhvm framework component composer release introduction podcast security install overview facebook unittest performance package hack application language

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