From 9bac98d175905b66fc256347f63f4edb612376de Mon Sep 17 00:00:00 2001 From: F4ilji Date: Mon, 6 Jul 2026 13:39:26 +0500 Subject: [PATCH] fix(logging): route EmailFetchException to email channel instead of app --- app/Containers/Dashboard/Commands/FetchEmailNewsCommand.php | 4 ++-- .../Dashboard/UI/WEB/Controllers/ParseEmailNewsController.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/Containers/Dashboard/Commands/FetchEmailNewsCommand.php b/app/Containers/Dashboard/Commands/FetchEmailNewsCommand.php index 274b4bf..cca2f25 100644 --- a/app/Containers/Dashboard/Commands/FetchEmailNewsCommand.php +++ b/app/Containers/Dashboard/Commands/FetchEmailNewsCommand.php @@ -66,7 +66,7 @@ class FetchEmailNewsCommand extends ConsoleCommand return $this->handleSync($fetchEmailNewsAction, $verbose); } catch (EmailFetchException $e) { $this->error('❌ Ошибка Email: ' . $e->getMessage()); - Log::channel('app')->error('EmailFetchException', [ + Log::channel('email')->error('EmailFetchException', [ 'code' => $e->getCode(), 'message' => $e->getMessage(), ]); @@ -76,7 +76,7 @@ class FetchEmailNewsCommand extends ConsoleCommand $this->error('❌ Критическая ошибка: ' . $e->getMessage()); $this->warn('Проверьте логи: storage/logs/laravel.log'); - Log::channel('app')->error('Critical Error', [ + Log::channel('email')->error('Critical Error', [ 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString(), ]); diff --git a/app/Containers/Dashboard/UI/WEB/Controllers/ParseEmailNewsController.php b/app/Containers/Dashboard/UI/WEB/Controllers/ParseEmailNewsController.php index 7c7b208..ac66bf5 100644 --- a/app/Containers/Dashboard/UI/WEB/Controllers/ParseEmailNewsController.php +++ b/app/Containers/Dashboard/UI/WEB/Controllers/ParseEmailNewsController.php @@ -38,13 +38,13 @@ class ParseEmailNewsController extends Controller "Обработано писем: {$result['processed_emails']}, но новостей не создано" ); } catch (EmailFetchException $e) { - Log::channel('app')->error('EmailFetchException', [ + Log::channel('email')->error('EmailFetchException', [ 'error' => $e->getMessage(), ]); return redirect()->back()->with('error', $e->getMessage()); } catch (\Exception $e) { - Log::channel('app')->error('Критическая ошибка', [ + Log::channel('email')->error('Критическая ошибка', [ 'error' => $e->getMessage(), 'trace' => $e->getTraceAsString(), ]);