Syslog log writer.
Class declared in SYSPATH/classes/log/syslog.php on line 3.
string
$_identlink to thisThe syslog identifier
array
$_log_levelslink to thisCreates 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
)
{
if
(Log::STRACE ==
$message
[
'level'
])
{
$message
[
'level'
] = Log::DEBUG;
}
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
);
}