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

write() public method

Appends a message to a log file.
See also: lithium\analysis\Logger::$_priorities
public write ( string $priority, string $message ) : Closure
$priority string The message priority. See `Logger::$_priorities`.
$message string The message to write to the log.
return Closure Function returning boolean `true` on successful write, `false` otherwise.
    public function write($priority, $message)
    {
        $config = $this->_config;
        return function ($self, $params) use(&$config) {
            $path = $config['path'] . '/' . $config['file']($params, $config);
            $params['timestamp'] = date($config['timestamp']);
            $message = String::insert($config['format'], $params);
            return file_put_contents($path, $message, FILE_APPEND);
        };
    }