Class Logger

Description

Located in /lib/Logger.php (line 65)


	
			
Class Constant Summary
Method Summary
 static object Current getInstance ([ $facility = LOG_DAEMON])
 void __destruct ()
 boolean debug (mixed $msg, [integer $to_level = 1])
 integer getDebugLevel ()
 mixed getIdentifier ()
 boolean loghttpd ([ $message = ''])
 boolean logit ([mixed $message = ''], [integer $criticality = LOG_INFO])
 boolean mailit ( $subject,  $message, [ $to = 'root'])
 boolean openFacility ([integer $facility = LOG_DAEMON])
 boolean setDebugLevel ([integer $var = 1])
 boolean setIdentifier ([mixed $name = NULL])
 boolean setLogToEmail ([boolean $var = true])
 void setLogToHttpd ([boolean $var = true])
 void setLogToStdErr ([boolean $var = true])
 void setLogToStdOut ([boolean $var = true])
 boolean showError ([mixed $error = NULL])
 boolean showMessage ([ $message = NULL], mixed $error)
 void __clone ()
Methods
static getInstance (line 201)

Get instance of this class

  • return: instance
  • access: public
object Current getInstance ([ $facility = LOG_DAEMON])
  • $facility
Destructor __destruct (line 96)

Close logging facilities and flush output buffering

  • access: public
void __destruct ()
debug (line 326)

Wrapper around the logit method. Log a message only if the specified level for this function is less or equal than the current debugging level.

  • return: True if successful, false otherwise
  • access: public
boolean debug (mixed $msg, [integer $to_level = 1])
  • mixed $msg: Message to log
  • integer $to_level: Debug level where this message should be displayed. Default 1.
getDebugLevel (line 367)

Get the current debugging level.

  • return: Current debug level
  • access: public
integer getDebugLevel ()
getIdentifier (line 192)

The name displayed in syslog

  • return: Name
  • access: public
mixed getIdentifier ()
loghttpd (line 222)

Log a message to the HTTPD log

This method is a wrapper around the error_log function

  • return: True if successful, false otherwise
  • access: public
boolean loghttpd ([ $message = ''])
  • $message
logit (line 233)

Log a message.

  • return: True if successful, false otherwise
  • access: public
boolean logit ([mixed $message = ''], [integer $criticality = LOG_INFO])
  • mixed $message: Message to log
  • integer $criticality: How critical is this message? Default is informational
mailit (line 307)

Send an email to root

This is a wrapper around the php mail function

  • return: True is mail successfully sent, false otherwise
  • access: public
boolean mailit ( $subject,  $message, [ $to = 'root'])
  • $subject
  • $message
  • $to
openFacility (line 434)

Open logging facility specified for the user

  • return: True if successful, false otherwise
  • access: public
boolean openFacility ([integer $facility = LOG_DAEMON])
  • integer $facility: Facility to open. Default is LOG_DAEMON
setDebugLevel (line 377)

Set debugging level. It will cause to print all debugging messages less or equal than the value we specify in this function.

  • return: True if successful, false otherwise
  • access: public
boolean setDebugLevel ([integer $var = 1])
  • integer $var: Debug level. Default 1. 0 means no debugging
setIdentifier (line 174)

Set the script name which will be displayed in syslog

  • return: True if successful, false otherwise
  • access: public
boolean setIdentifier ([mixed $name = NULL])
  • mixed $name: Name to set to
setLogToEmail (line 107)

Divert logging to Email

  • return: True if successful, false otherwise
  • access: public
boolean setLogToEmail ([boolean $var = true])
  • boolean $var: Activate or deactivate LogToEmail logging. Default is to activate ($var=true)
setLogToHttpd (line 123)

Divert logging to httpd

  • access: public
void setLogToHttpd ([boolean $var = true])
  • boolean $var: Activate or deactivate httpd logging. Default is to activate ($var=true)
setLogToStdErr (line 139)

Divert logging to StdErr

  • access: public
void setLogToStdErr ([boolean $var = true])
  • boolean $var: Activate or deactivate StdErr logging. Default is to activate ($var=true)
setLogToStdOut (line 156)

Divert logging to StdOut

  • access: public
void setLogToStdOut ([boolean $var = true])
  • boolean $var: Activate or deactivate StdOut logging. Default is to activate ($var=true)
showError (line 416)

Wrapper around the logit method.

This method logs by default to the stderr stream defined by the chosen facility

  • return: True if successful, false otherwise
  • access: public
boolean showError ([mixed $error = NULL])
  • mixed $error: The error message to display
showMessage (line 397)

Wrapper around the logit method.

This method logs by default to the stdout stream defined by the chosen facility

  • return: True if successful, false otherwise
  • access: public
boolean showMessage ([ $message = NULL], mixed $error)
  • mixed $error: The error message to display
  • $message
__clone (line 212)

Prevent clonning the instance

  • throws: Exception indicating that copy can't be performed
  • access: public
void __clone ()
Class Constants
MAX_DEBUG_LEVEL = 3 (line 70)

Maximum debugging level

Documentation generated on Mon, 06 Oct 2008 01:10:33 +0200 by phpDocumentor 1.4.0