Syslog log writer.
Class declared in SYSPATH/classes/log/syslog.php on line 3.
string $_identThe syslog identifier
array $_log_levelsarray $_syslog_levelslog levels
Creates a new syslog logger.
string
$ident
= string(9) "KohanaPHP" - Syslog identifierint
$facility
= integer 8 - Facility to log tovoidpublic function __construct($ident = 'KohanaPHP', $facility = LOG_USER)
{
$this->_ident = $ident;
// Open the connection to syslog
openlog($this->_ident, LOG_CONS, $facility);
}
Closes the syslog connection
voidpublic function __destruct()
{
// Close connection to syslog
closelog();
}
Writes each of the messages into the syslog.
array
$messages
required - $messagesvoidpublic function write(array $messages)
{
foreach ($messages as $message)
{
syslog($message['level'], $message['body']);
}
}
Allows the writer to have a unique key when stored.
echo $writer;
stringfinal public function __toString()
{
return spl_object_hash($this);
}