Syslog log writer.
Class declared in SYSPATH/classes/kohana/log/syslog.php on line 11.
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 tovoid
public 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
void
public function __destruct()
{
// Close connection to syslog
closelog();
}
Writes each of the messages into the syslog.
array
$messages
required - $messagesvoid
public 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;
string
final public function __toString()
{
return spl_object_hash($this);
}