Modules

Kohana_Log_Syslog
extends Log_Writer
extends Kohana_Log_Writer

Syslog log writer.

package
Kohana
category
Logging
author
Jeremy Bush
copyright
© 2012 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 $_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

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)
	{
		if (Log::STRACE == $message['level'])
		{
			$message['level'] = Log::DEBUG;
		}
		syslog($message['level'], $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);
}