@extends('layouts.app') @section('title', 'Error Logs | Admin') @section('content')
{{-- Header --}}
Dashboard

Error Logs

{{ count($lines) }} entries shown Refresh
{{-- Filters --}}
{{-- Log lines, grouped — each entry's stack trace (lines beginning with `#N `, `[stacktrace]`, or `Stack trace:`) is folded into its parent header line. Headers show their level color; stack trace lines render in a muted indent and preserve their natural #0 → #N order inside each group even when the overall list is newest-first. --}} @if(empty($lines))
No log entries found{{ $filter || $level ? ' matching your filter' : '' }}.
@else @php // Group the flat list of lines into [{header, trace[]}, …]. // Any line that is NOT a header starts/continues the current // group's trace. Lines that look like a header (ERROR/WARNING/ // INFO/DEBUG) start a new group. $groups = []; $current = null; $isHeader = fn ($l) => (bool) preg_match('/\.(ERROR|WARNING|INFO|DEBUG|CRITICAL|ALERT|EMERGENCY|NOTICE):/', $l); foreach ($lines as $line) { if ($isHeader($line) || $current === null) { if ($current) $groups[] = $current; $current = ['header' => $line, 'trace' => []]; } else { $current['trace'][] = $line; } } if ($current) $groups[] = $current; @endphp
@foreach($groups as $gi => $g) @php $color = '#aaa'; if (str_contains($g['header'], '.ERROR:') || str_contains($g['header'], '.CRITICAL:')) $color = '#f87171'; elseif (str_contains($g['header'], '.WARNING:')) $color = '#fbbf24'; elseif (str_contains($g['header'], '.INFO:')) $color = '#6ee7b7'; elseif (str_contains($g['header'], '.DEBUG:')) $color = '#93c5fd'; $hasTrace = !empty($g['trace']); @endphp
@if($hasTrace) @else @endif {{ $g['header'] }}
@if($hasTrace) @endif
@endforeach
@endif
@endsection