Modules

Kohana_Log_Syslog
extends Kohana_Log_Writer

Syslog log writer.

package
Kohana
category
Logging
author
Jeremy Bush
copyright
© 2010 Kohana Team
license
http://kohanaframework.org/license

Class declared in SYSPATH/classes/kohana/log/syslog.php on line 11.

Properties

protected string $_ident

The syslog identifier

protected array $_syslog_levels

log 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

  • See - http://us2.php.net/openlog

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);
}