Pages

Sunday, February 20, 2011

PHP Logging Libraries

Recently while doing a project, I came across the need of a PHP logging library. The search for a php logging framework found me a few interesting results. The following are the libraries that I came across.

1) log4php
This logging library seems to be the most feature-rich library available. The RollingFile and DailyFile logging systems in this library can come in quite useful. Mail and Database logging are also available. This library can be configured using xml, properties file or through code, just like log4j. The log message format can be configured using layouts. This library is ideal for someone who is experienced with using log4j. The file compression functionality does not seem to be present in log4php at this time.

2) Zend_Log
This the Zend library component for logging. Other than logging to a file you can log to a database or email as well. Similar to log4php with Zend_Log you can configure the logged message's format.

3) Pear Logging Framework
This is the pear library for logging. This library supports logging to file,database and mail. You also have the option of setting the format of the log message.

4) KLogger
This library can log to file only. So for a lightweight application that does not require logging to database and email, this library can be used.

Hope this helped you to find the logging library that best suits your needs. You can follow the above links to find out more.

1 comment:

  1. The log4 series of libraries have never let me down, no matter which language I'm using.

    ReplyDelete