feat(StoreStorageSend): 添加错误日志记录到队列消费失败时

This commit is contained in:
mkm 2024-06-12 13:35:22 +08:00
parent ac9a921ee8
commit c42b9a5033
3 changed files with 3 additions and 2 deletions

View File

@ -109,6 +109,7 @@ class StoreStorageSend implements Consumer
public function onConsumeFailure(\Throwable $e, $package) public function onConsumeFailure(\Throwable $e, $package)
{ {
$package['max_attempts'] = 0; $package['max_attempts'] = 0;
Log::error('store-storage队列消费失败: ' . $e->getMessage() . ',line:' . $e->getLine() . ',file:' . $e->getFile());
return $package; return $package;
} }
} }

View File

@ -20,7 +20,7 @@ return [
'constructor' => [ 'constructor' => [
runtime_path() . '/logs/'.date('Ym').'/.log', runtime_path() . '/logs/'.date('Ym').'/.log',
2048, 2048,
Monolog\Logger::DEBUG, Monolog\Logger::NOTICE,
true, true,
0755 0755
], ],

View File

@ -20,7 +20,7 @@ return [
'constructor' => [ 'constructor' => [
'redis-queue', 'redis-queue',
7, //$maxFiles 7, //$maxFiles
Monolog\Logger::DEBUG, Monolog\Logger::NOTICE,
], ],
'formatter' => [ 'formatter' => [
'class' => Monolog\Formatter\LineFormatter::class, 'class' => Monolog\Formatter\LineFormatter::class,