LOGS, 'facility' => $default_facility); $this->_ident = $options['ident']; $this->_facility = $options['facility']; } /** * Implements writing to the specified syslog * * @param string $type The type of log you are making. * @param string $message The message you want to log. * @return boolean success of write. */ function write($type, $message) { $debugTypes = array('notice', 'info', 'debug'); $priority = LOG_INFO; if ($type == 'error' || $type == 'warning') { $priority = LOG_ERR; } else if (in_array($type, $debugTypes)) { $priority = LOG_DEBUG; } if (!openlog($this->_ident, LOG_PID | LOG_PERROR, $this->_facility)) { return false; } $output = date('Y-m-d H:i:s') . ' ' . ucfirst($type) . ': ' . $message; $result = syslog($priority, $output); closelog(); return $result; } }