| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- session_start();
- require_once "../env.inc.php";
- require_once "../access.inc.php";
- require_once "../conf.inc.php";
- require_once DIR_PHP_LAYOUTS . "header.php";
- require_once DIR_PHP_LAYOUTS . "cms.session.php";
- if (!is_readable(SERVER_LOGS)) {
- echo "Le fichier n'est pas accessible en lecture.";
- exit();
- }
- $lines = file(SERVER_LOGS);
- $search = strtolower($_GET['search'] ?? '');
- $limit = strtolower($_GET['limit'] ?? 50); // A défaut les 50 derniers logs
- if ($search) {
- $lines = array_filter($lines, fn($line) => stripos($line, $search) !== false);
- }
- $lines = array_reverse($lines);
- ?>
- <!DOCTYPE html>
- <html lang="fr">
- <head>
- <meta charset="UTF-8">
- <style>
- body { font-family: monospace; background: black !important; padding: 20px; }
- div { font-size: 0.8em; }
- .error { color: salmon; }
- .warning { color: orange; }
- .notice { color: white; }
- .grey { color: grey; }
- pre { background: #fff; padding: 10px; border: 1px solid #ccc; overflow-x: auto; }
- </style>
- <link rel="stylesheet" href="<?php cache::printFileWithTime("libs/bootstrap/assets/dist/css/bootstrap.min.css") ?>">
- <script src="<?php cache::printFileWithTime("libs/bootstrap/js/bootstrap.min.js") ?>"></script>
- </head>
- <body>
- <?php
- foreach (array_slice($lines, 0, $limit) as $line) {
- serverLog::filtreLog($line);
- }
- ?>
- </body>
- </html>
|