File/lib/Logger.php

Description

Logger.php

PHP version 5

LICENSE: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.

Classes
Class Description
 class Logger
Constants
WEB = 500 (line 63)

Define the Logger class which is a Singleton which provides for logging facilities.

This class uses the constants defined by Syslog, which are listed as follows:

  • LOG_EMERG 0 System is unusable
  • LOG_ALERT 1 Action must be taken immediately
  • LOG_CRIT 2 Critical conditions
  • LOG_ERR 3 Error conditions
  • LOG_WARNING 4 Warning conditions
  • LOG_NOTICE 5 Normal, but significant condition
  • LOG_INFO 6 Informational message
  • LOG_DEBUG 7 Debug-level-message
Example usage:
  • $logger=Logger::getInstance(); Needed, before other lines
  • $logger->setDebugLevel(3); Log debug1,2,3 (default is only 1)
  • $logger->setLogToStdErr(); If you don't want to use syslog
  • $logger->logit("Hello world"); Will appear in syslog or stderr
  • $logger->debug("Hello debug world"); Will be prefixed "debug1"
  • $logger->debug("Hello debug world",3); Will be prefixed "debug3"

Documentation generated on Mon, 01 Dec 2008 01:10:36 +0100 by phpDocumentor 1.4.0