@if(is_array($logs) && count($logs) > 0)
@foreach($logs as $index => $log)
@php
// Determine Log Level
$colorClass = 'text-gray-300';
$borderClass = 'border-l-2 border-transparent';
$bgClass = '';
$icon = '';
if (Str::contains($log, ['.ERROR:', '.CRITICAL:', '.ALERT:', '.EMERGENCY:'])) {
$colorClass = 'text-red-400';
$borderClass = 'border-l-2 border-red-500';
$bgClass = 'bg-red-500/5';
$icon = '❌';
} elseif (Str::contains($log, ['.WARNING:', '.NOTICE:'])) {
$colorClass = 'text-yellow-400';
$borderClass = 'border-l-2 border-yellow-500';
$bgClass = 'bg-yellow-500/5';
$icon = '⚠️';
} elseif (Str::contains($log, ['.INFO:', '.DEBUG:'])) {
$colorClass = 'text-blue-300';
$borderClass = 'border-l-2 border-blue-500';
$icon = 'ℹ️';
} else {
$borderClass = 'border-l-2 border-gray-700';
}
// Parse timestamp if exists
$logContent = htmlspecialchars($log);
preg_match('/^\[(\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2})\]/', $log, $matches);
$timestamp = $matches[1] ?? '';
if($timestamp) {
$logContent = str_replace(
"[{$timestamp}]",
"
",
$logContent
);
// Highlight environment/channel usually after timestamp e.g. local.ERROR:
$logContent = preg_replace(
'/(\w+)\.([A-Z]+):/',
"
.
:",
$logContent
);
}
@endphp
No logs found
Typical, everything is running smoothly!