@extends('admin.layout') @section('title', 'سجلات النظام') @section('header', 'سجلات النظام (System Logs)') @section('content')

System Logs

Showing last 200 entries
@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}]", "[{$timestamp}]", $logContent ); // Highlight environment/channel usually after timestamp e.g. local.ERROR: $logContent = preg_replace( '/(\w+)\.([A-Z]+):/', "$1.$2:", $logContent ); } @endphp
{{ count($logs) - $index }}
{!! $logContent !!}
@endforeach @else

No logs found

Typical, everything is running smoothly!

@endif
Live View (Static)
{{ is_array($logs) ? count($logs) : 0 }} lines loaded • Source: storage/logs/laravel.log
@endsection