lithium\analysis\logger\adapter\Cache::write PHP Method

write() public method

Writes the message to the configured cache adapter.
public write ( string $priority, string $message ) : Closure
$priority string
$message string
return Closure Function returning boolean `true` on successful write, `false` otherwise.
    public function write($priority, $message)
    {
        $config = $this->_config + $this->_classes;
        return function ($self, $params) use($config) {
            $params += array('timestamp' => strtotime('now'));
            $key = $config['key'];
            $key = is_callable($key) ? $key($params) : String::insert($key, $params);
            $cache = $config['cache'];
            return $cache::write($config['config'], $key, $params['message'], $config['expiry']);
        };
    }