Class Log_syslog

Description

The Log_syslog class is a concrete implementation of the Log:: abstract class which sends messages to syslog on UNIX-like machines (PHP emulates this with the Event Log on Windows machines).

  • example: example not found
  • since: Horde 1.3
  • since: Log 1.0
  • author: Chuck Hagenbuch <chuck@horde.org>

Located in /maintenance/libraries/pear/Log/syslog.php (line 22)

Log
   |
   --Log_syslog
Variable Summary
 string $_name
Method Summary
 Log_syslog Log_syslog (string $name, [string $ident = ''], [array $conf = array()], [int $level = PEAR_LOG_DEBUG])
 void close ()
 boolean log (mixed $message, [int $priority = null])
 void open ()
 The _toSyslog (int $priority)
Variables
string $_name = LOG_SYSLOG (line 29)

Integer holding the log facility to use.

  • access: private

Inherited Variables

Inherited from Log

Log::$_id
Log::$_ident
Log::$_listeners
Log::$_mask
Log::$_opened
Log::$_priority
Methods
Constructor Log_syslog (line 40)

Constructs a new syslog object.

  • access: public
Log_syslog Log_syslog (string $name, [string $ident = ''], [array $conf = array()], [int $level = PEAR_LOG_DEBUG])
  • string $name: The syslog facility.
  • string $ident: The identity string.
  • array $conf: The configuration array.
  • int $level: Log messages up to and including this level.
close (line 73)

Closes the connection to the system logger, if it is open.

  • access: public
void close ()

Redefinition of:
Log::close()
Abstract implementation of the close() method.
log (line 96)

Sends $message to the currently open syslog connection. Calls open() if necessary. Also passes the message along to any Log_observer instances that are observing this Log.

  • return: True on success or false on failure.
  • access: public
boolean log (mixed $message, [int $priority = null])
  • mixed $message: String or object containing the message to log.
  • int $priority: (optional) The priority of the message. Valid values are: PEAR_LOG_EMERG, PEAR_LOG_ALERT, PEAR_LOG_CRIT, PEAR_LOG_ERR, PEAR_LOG_WARNING, PEAR_LOG_NOTICE, PEAR_LOG_INFO, and PEAR_LOG_DEBUG.

Redefinition of:
Log::log()
Abstract implementation of the log() method.
open (line 59)

Opens a connection to the system logger, if it has not already been opened. This is implicitly called by log(), if necessary.

  • access: public
void open ()

Redefinition of:
Log::open()
Abstract implementation of the open() method.
_toSyslog (line 139)

Converts a PEAR_LOG_* constant into a syslog LOG_* constant.

This function exists because, under Windows, not all of the LOG_* constants have unique values. Instead, the PEAR_LOG_* were introduced for global use, with the conversion to the LOG_* constants kept local to to the syslog driver.

  • return: LOG_* representation of $priority.
  • access: private
The _toSyslog (int $priority)
  • int $priority: PEAR_LOG_* value to convert to LOG_* value.

Inherited Methods

Inherited From Log

 Log::alert()
 Log::attach()
 Log::close()
 Log::crit()
 Log::debug()
 Log::detach()
 Log::emerg()
 Log::err()
 Log::factory()
 Log::flush()
 Log::getIdent()
 Log::getMask()
 Log::getPriority()
 Log::info()
 Log::isComposite()
 Log::log()
 Log::MASK()
 Log::notice()
 Log::open()
 Log::priorityToString()
 Log::setIdent()
 Log::setMask()
 Log::setPriority()
 Log::singleton()
 Log::UPTO()
 Log::warning()
 Log::_announce()
 Log::_extractMessage()
 Log::_isMasked()

Documentation generated on Fri, 10 Dec 2004 18:26:33 +0000 by phpDocumentor 1.3.0RC3