Extends
lithium\core\Object
Appends `$message` to the system log.
Parameters
- string $priority The message priority string. Maps to a `syslogd` priority constant.
- string $message The message to write.
Returns
closure Function returning boolean `true` on successful write, `false` otherwise.Source
public function write($priority, $message) {
$config = $this->_config;
$_priorities = $this->_priorities;
if (!$this->_isConnected) {
closelog();
openlog($config['identity'], $config['options'], $config['facility']);
$this->_isConnected = true;
}
return function($self, $params) use ($_priorities) {
$priority = $_priorities[$params['priority']];
return syslog($priority, $params['message']);
};
}