В общем додумался сам:
$server = "xxx";
$username = 'xxx';
$password = 'xxx';
$dir = "xxx";
$ftp_conn = ftp_connect($server) or die("Could not connect to $server");
$login = ftp_login($ftp_conn, $username, $password);
$files = ftp_nlist($ftp_conn, $dir);
foreach ($files as $file) {
$ext = pathinfo($file)['extension'];
if ( $ext === 'log' ) {
$path = "ftp://$username:$password@$server/$file";
$file = fopen($path, "r");
while ( ($line = fgets($file)) !== false ) {
echo $line . "<br />";
}
break;
}
}
ftp_close($ftp_conn);