Modules
Kohana_Log_Syslog
extends Kohana_Log_Writer
Syslog log writer.
Class declared in SYSPATH/classes/kohana/log/syslog.php on line 11.
Constants
- None
Properties
Methods
Properties
protected
string$_identThe syslog identifier
protected
array$_syslog_levelslog levels
Methods
public __construct( [ string $ident = string(9) "KohanaPHP" , int $facility = integer 8 ] ) (defined in Kohana_Log_Syslog)
Creates a new syslog logger.
Parameters
-
string$ident = string(9) "KohanaPHP" - Syslog identifier -
int$facility = integer 8 - Facility to log to
Tags
Return Values
void
Source Code
public function __construct($ident = 'KohanaPHP', $facility = LOG_USER)
{
$this->_ident = $ident;
// Open the connection to syslog
openlog($this->_ident, LOG_CONS, $facility);
}
public __destruct( ) (defined in Kohana_Log_Syslog)
Closes the syslog connection
Return Values
void
Source Code
public function __destruct()
{
// Close connection to syslog
closelog();
}
public write( array $messages ) (defined in Kohana_Log_Syslog)
Writes each of the messages into the syslog.
Parameters
-
array$messages required - Messages
Return Values
void
Source Code
public function write(array $messages)
{
foreach ($messages as $message)
{
syslog($this->_syslog_levels[$message['type']], $message['body']);
}
}
final public __toString( ) (defined in Kohana_Log_Writer)
Allows the writer to have a unique key when stored.
echo $writer;
Return Values
string
Source Code
final public function __toString()
{
return spl_object_hash($this);
}