';
foreach ($shown_entries as $entry) {
if (empty(trim($entry))) continue;
// Parse log entry
if (preg_match('/\[(.*?)\] (.*?) \| (.*)/', $entry, $matches)) {
$timestamp = $matches[1];
$message = $matches[2];
$data = $matches[3];
$is_error = (strpos($message, 'ERROR') !== false || strpos($message, 'FATAL') !== false);
echo '
';
echo '
' . htmlspecialchars($timestamp) . '
';
echo '
' . htmlspecialchars($message) . '
';
// Pretty print JSON data
$decoded = json_decode($data, true);
if ($decoded) {
echo '
' . htmlspecialchars(json_encode($decoded, JSON_PRETTY_PRINT)) . '
';
} else {
echo '
' . htmlspecialchars($data) . '
';
}
echo '