Undefined index: plugin.webman.redis-queue.default

zhaohanfeng

问题描述

在启动webman时出现报错
Undefined index: plugin.webman.redis-queue.default in /data/develop/Downway/vendor/workerman/webman-framework/src/support/Log.php:50

是不是因为在同一服务器上启动多个任务造成的?

报错信息

2024-04-09 14:29:35 pid:23372 ErrorException: Undefined index: plugin.webman.redis-queue.default in /data/develop/Downway/vendor/workerman/webman-framework/src/support/Log.php:50
Stack trace:
#0 /data/develop/Downway/vendor/workerman/webman-framework/src/support/Log.php(50): {closure}(8, 'Undefined index...', '/data/develop/D...', 50, Array)
#1 /data/develop/Downway/vendor/webman/redis-queue/src/Client.php(48): support\Log::channel('plugin.webman.r...')
#2 /data/develop/Downway/vendor/webman/redis-queue/src/Process/Consumer.php(69): Webman\RedisQueue\Client::connection('default')
#3 /data/develop/Downway/support/helpers.php(410): Webman\RedisQueue\Process\Consumer->onWorkerStart(Object(Workerman\Worker))
#4 /data/develop/Downway/support/helpers.php(462): worker_bind(Object(Workerman\Worker), Object(Webman\RedisQueue\Process\Consumer))
#5 /data/develop/Downway/vendor/workerman/workerman/Worker.php(2497): {closure}(Object(Workerman\Worker))
#6 /data/develop/Downway/vendor/workerman/workerman/Worker.php(1636): Workerman\Worker->run()
#7 /data/develop/Downway/vendor/workerman/workerman/Worker.php(1429): Workerman\Worker::forkOneWorkerForLinux(Object(Workerman\Worker))
#8 /data/develop/Downway/vendor/workerman/workerman/Worker.php(1403): Workerman\Worker::forkWorkersForLinux()
#9 /data/develop/Downway/vendor/workerman/workerman/Worker.php(1788): Workerman\Worker::forkWorkers()
#10 /data/develop/Downway/vendor/workerman/workerman/Worker.php(1724): Workerman\Worker::monitorWorkersForLinux()
#11 /data/develop/Downway/vendor/workerman/workerman/Worker.php(562): Workerman\Worker::monitorWorkers()
#12 /data/develop/Downway/vendor/workerman/webman-framework/src/support/App.php(124): Workerman\Worker::runAll()
#13 /data/develop/Downway/start.php(4): support\App::run()
#14 {main}

操作系统及workerman/webman等框架组件具体版本

centos6.5,"workerman/webman-framework": "1.4.7"

520 1 0
1个回答

walkor 打赏

加个配置 config/plugin/webman/redis-queue/log.php

<?php
return [
    'default' => [
        'handlers' => [
            [
                'class' => Monolog\Handler\RotatingFileHandler::class,
                'constructor' => [
                    runtime_path() . '/logs/redis-queue/queue.log',
                    7, //$maxFiles
                    Monolog\Logger::DEBUG,
                ],
                'formatter' => [
                    'class' => Monolog\Formatter\LineFormatter::class,
                    'constructor' => [null, 'Y-m-d H:i:s', true],
                ],
            ]
        ],
    ]
];
  • owenzhang 22天前

    我添加了,然后得重启才该用,过阵子后又报这个错误,又得重启,怎么这么麻烦?

  • owenzhang 22天前

    还得创建一个文件,config/plugin/webman/redis-queue/app.php,app.php文件内容为:<?php
    return [
    'enable' => true,
    ];

×
🔝