Skip to content

Can't display logs from server correctly from configuration.php #4

Description

@anthlasserre

I try to display different logs on the page configuration.php.
Firstly with a simple function:
$file='/var/log/apache2/error.log';
$contenu=file_get_contents($file);
echo $contenu;

But I have a problem when the file is too big.
The lasts log lines are at the bottom of the file so I have to scroll for 20 seconds before to see the lasts logs.

So try an another function:
$fp = fopen ('/var/log/apache2/error.log','r');
$page = '';
while (!feof ($fp)) {
$page = fgets ($fp, 4096) . $page . '
';
fclose ($fp);
echo $page;
}

And it works only on syslog even if I have multiple empty lines at the end.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions