Laravel队列Supervisor无法正常运行问题排查求助
Laravel调度任务无日志输出排查
基础信息
- 预期效果:worker.log中生成类似「server check finished.」的日志条目
- 实际情况:Laravel日志文件无任何记录,也没有worker运行的反馈信息
- 运行环境:Debian + supervisord,终端手动启动队列可正常执行任务
调度任务代码(Kernel.php)
/** * 定义应用的命令调度 * * @param \Illuminate\Console\Scheduling\Schedule $schedule * @return void */ protected function schedule(Schedule $schedule) { // $schedule->command('inspire')->hourly(); $schedule->job(new CheckServerStatusJob) ->evenInMaintenanceMode() ->everyMinute() ->after(function () { info('server check finished.'); }) ->onFailure(function () { info('server check failed.'); exec('php artisan down'); }); }
Supervisor配置说明
原截图展示了针对Laravel的Supervisor配置内容(已移除外部链接)
分析输出说明
原截图展示了相关分析输出内容(已移除外部链接)
Supervisor日志记录
2022-10-20 09:21:32,015 INFO success: lv_two_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-10-20 09:21:32,016 INFO spawned: 'lv_two_02' with pid 6427 2022-10-20 09:21:33,017 INFO success: lv_two_02 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-10-20 09:32:54,075 INFO waiting for lv_two_01 to stop 2022-10-20 09:32:54,075 INFO waiting for lv_two_00 to stop 2022-10-20 09:32:54,075 INFO waiting for lv_two_02 to stop 2022-10-20 09:32:54,080 INFO stopped: lv_two_01 (exit status 0) 2022-10-20 09:32:54,084 INFO stopped: lv_two_00 (exit status 0) 2022-10-20 09:32:54,084 INFO stopped: lv_two_02 (exit status 0) 2022-10-20 09:32:55,088 INFO spawned: 'lv_two_01' with pid 8404 2022-10-20 09:32:55,090 INFO spawned: 'lv_two_00' with pid 8405 2022-10-20 09:32:55,122 INFO spawned: 'lv_two_02' with pid 8406 2022-10-20 09:32:56,123 INFO success: lv_two_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-10-20 09:32:56,124 INFO success: lv_two_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-10-20 09:32:56,124 INFO success: lv_two_02 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-10-20 09:32:58,789 INFO waiting for lv_two_01 to stop 2022-10-20 09:32:58,789 INFO waiting for lv_two_00 to stop 2022-10-20 09:32:58,789 INFO waiting for lv_two_02 to stop 2022-10-20 09:32:58,793 INFO stopped: lv_two_02 (exit status 0) 2022-10-20 09:32:58,793 INFO stopped: lv_two_01 (exit status 0) 2022-10-20 09:32:58,793 INFO stopped: lv_two_00 (exit status 0) 2022-10-20 09:33:04,566 INFO spawned: 'lv_two_01' with pid 8451 2022-10-20 09:33:04,567 INFO spawned: 'lv_two_00' with pid 8452 2022-10-20 09:33:04,569 INFO spawned: 'lv_two_02' with pid 8453 2022-10-20 09:33:05,570 INFO success: lv_two_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-10-20 09:33:05,570 INFO success: lv_two_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) 2022-10-20 09:33:05,570 INFO success: lv_two_02 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
内容的提问来源于stack exchange,提问作者ID64356
相关产品推荐
相关产品推荐

