Collective\Remote\Console\TailCommand::tailRemoteLogs PHP Method

tailRemoteLogs() protected method

Tail a remote log file at the given path and connection.
protected tailRemoteLogs ( string $path, string $connection ) : void
$path string
$connection string
return void
    protected function tailRemoteLogs($path, $connection)
    {
        $out = $this->output;
        $lines = $this->option('lines');
        $this->getRemote($connection)->run('cd ' . escapeshellarg($path) . ' && tail -f $(ls -t | head -n 1) -n ' . $lines, function ($line) use($out) {
            $out->write($line);
        });
    }