errors handled in the correct log file

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

View File

@@ -19,7 +19,7 @@ class BilletController extends Controller
try {
$billets = Billet::all();
} 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('index', compact('billets'));

View File

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