53 if (empty($name) || !is_int($name)) {
57 if (isset($conf[
'inherit'])) {
58 $this->_inherit = $conf[
'inherit'];
62 $this->_id = md5(microtime());
64 $this->_ident = $ident;
75 if (!$this->_opened) {
76 $this->_opened = openlog($this->_ident, LOG_PID, $this->_name);
88 if ($this->_opened && !$this->_inherit) {
90 $this->_opened =
false;
109 function log($message, $priority = null)
112 if ($priority === null) {
122 if (!$this->_opened && !$this->
open()) {
131 if ($this->_inherit) {
135 if (!syslog($priority, $message)) {
139 $this->
_announce(array(
'priority' => $priority,
'message' => $message));
160 static $priorities = array(
172 if (!is_int($priority) || !in_array($priority, $priorities)) {
176 return $priorities[$priority];
_announce($event)
Informs each registered observer instance that a new message has been logged.
UPTO($priority)
Calculate the log mask for all priorities up to the given priority.
_toSyslog($priority)
Converts a PEAR_LOG_* constant into a syslog LOG_* constant.
log($message, $priority=null)
Sends $message to the currently open syslog connection.
close()
Closes the connection to the system logger, if it is open.
Log_syslog($name, $ident='', $conf=array(), $level=PEAR_LOG_DEBUG)
Constructs a new syslog object.
_isMasked($priority)
Check if the given priority is included in the current level mask.
_extractMessage($message)
Returns the string representation of the message data.
open()
Opens a connection to the system logger, if it has not already been opened.