@extends('layouts.admin') @section('style') @parent @include('admin.system._style') @endsection @section('content') @php $levelLook = []; foreach (['errors' => 'is-bad', 'warnings' => 'is-warn', 'info' => 'is-live', 'debug' => 'is-quiet'] as $group => $class) { foreach (\App\Http\Controllers\Admin\SystemController::LEVEL_TABS[$group] as $lvl) { $levelLook[$lvl] = $class; } } $tabLabels = ['errors' => 'Errors', 'warnings' => 'Warnings', 'info' => 'Info', 'debug' => 'Debug']; $active = $filters['level'] ?? null; $search = $filters['q'] ?? null; $base = ['channel' => $channel, 'file' => $file]; $tabUrl = fn ($key) => route('admin.system.logs', array_merge($base, array_filter(['q' => $search, 'level' => $key])), false); $fileLabel = function ($name) { if (! preg_match('/(\d{4}-\d{2}-\d{2})/', $name, $m)) return $name; $day = \Carbon\Carbon::parse($m[1]); return $day->isToday() ? 'Today' : ($day->isYesterday() ? 'Yesterday' : $day->format('D, j M Y')); }; $size = function ($bytes) { $units = ['B', 'KB', 'MB', 'GB']; $i = $bytes > 0 ? min((int) floor(log($bytes, 1024)), 3) : 0; return round($bytes / (1024 ** $i), $i ? 1 : 0) . ' ' . $units[$i]; }; @endphp

Logs

Read-only view of storage/logs on {{ gethostname() }}. Other servers keep their own.
@if($file) Download file @endif
@if($tooBig) @endif
@if($files->isEmpty())
No log files yet
The app writes one file per day to storage/logs once something is logged.
@elseif($entries->isEmpty() && ! $tooBig)
@if($active || $search)
No entries match
@else
This file is empty
Pick another day from the list above.
@endif
@else @foreach($entries as $e) @php $parsed = $e['level'] !== ''; $isError = ($levelLook[$e['level']] ?? null) === 'is-bad'; $long = trim($e['stack']) !== '' || mb_strlen($e['text']) > 300; $at = $parsed ? rescue(fn () => \Carbon\Carbon::parse($e['date']), null, false) : null; @endphp
@if($parsed) {{ ucfirst($e['level']) }} @else Line {{ $e['date'] }} @endif @if($at){{ $at->format('H:i:s') }}{{ $at->format('j M') }}@endif

{{ $e['text'] }}

@if($long)
Full entry
{{ $e['text'] }}@if(trim($e['stack']) !== '')

{{ $e['stack'] }}@endif
@endif
@endforeach @endif
@include('admin.system._pager', ['p' => $entries])
@endsection