errors handled in the correct log file

This commit is contained in:
2025-05-12 16:46:31 +02:00
parent f4aa84a82d
commit b7f8629c2b
2 changed files with 7 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ class BilletController extends Controller
try { try {
$billets = Billet::all(); $billets = Billet::all();
} catch (\Illuminate\Database\QueryException $e) { } catch (\Illuminate\Database\QueryException $e) {
Log::error('Erreur accès à la base de donnée'); Log::channel('projectError')->error('Erreur d\'accès à la base de données');
return view('errors.unavailable'); return view('errors.unavailable');
} }
return view('index', compact('billets')); return view('index', compact('billets'));

View File

@@ -127,6 +127,12 @@ return [
'path' => storage_path('logs/laravel.log'), 'path' => storage_path('logs/laravel.log'),
], ],
"projectError" => [
'driver' => 'single',
'path' => storage_path('logs/project.log'),
'level' => 'error',
],
], ],
]; ];