fix(logging): route EmailFetchException to email channel instead of app

This commit is contained in:
F4ilji
2026-07-06 13:39:26 +05:00
parent 65f4220932
commit 9bac98d175
2 changed files with 4 additions and 4 deletions
@@ -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(),
]);
@@ -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(),
]);