Recommend this page to a friend! |
Download .zip |
Info | View files (2) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2007-09-21 (9 years ago) | Not yet rated by the users | Total: 438 This week: 1 | All time: 5,943 This week: 1,047 |
Version | License | PHP version | Categories | |||
bpt_logger 0.2 | GNU Lesser Genera... | 5.0 | PHP 5, Logging |
Description | Author | |
This class can be used to log messages to a file. |
*** Use example *** How it works? It's extremely simple! First of all, you have to include it with require("logger.class.php"); then create it (setting log file name) with $logger = new Logger('./logs/'.date("Y-m-d").'TestLog.log'); and now you can use it! Call this method to append log information $logger->append(constant("LOG_INFO"),'Log information'); By default, log level is set to LOG_INFO. Setting log level determinate what information will be write into the log file. In this way, you can use append method to log every operation using different log level (the first method's parameter) but only the information having a log level minus or equal to the Logger's level will be registered. For example $logger->setLogLevel(constant("LOG_DEBUG")); $logger->append(constant("LOG_INFO"),'Log information'); $logger->append(constant("LOG_DEBUG"),'Debug log information'); In this case, only the first information will be logged. You can change logging's verbosity simply setting $logger->setLogLevel($log_level); where $log_level can assume these values LOG_ERROR LOG_WARNING LOG_INFO LOG_DEBUG If you don't want to use custom log level you can call this method instead of append: $logger->error($msg) //Append $msg with LOG_ERROR level $logger->warning($msg) //Append $msg with LOG_WARNING level $logger->info($msg) //Append $msg with LOG_INFO level $logger->debug($msg) //Append $msg with LOG_DEBUG level |
Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
0% |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.