【问题标题】:Enable Verbose mode for Laravel 4 Queue Listener为 Laravel 4 队列监听器启用详细模式
【发布时间】:2013-03-27 05:19:35
【问题描述】:

当通过php artisan queue:listen 运行监听器时,它非常安静,即使 Worker 可能正在回显某些内容。

问题:如何让这些回声显示在屏幕上,类似于php artisan queue:work 的做法?

【问题讨论】:

    标签: php queue laravel laravel-4


    【解决方案1】:

    听得很安静。就个人而言,我使用 OS X / Linux 并在另一个终端窗口中运行以下命令来监视输出。

    tail -f storage/logs/*
    

    【讨论】:

      【解决方案2】:

      php artisan queue:listen 现在会在运行时将工作器输出呈现到控制台。不需要详细模式。

      【讨论】:

      • 在哪个版本的 Laravel 中?这个问题专门针对 Laravel 4,而在 Laravel 4.2 中绝对不是这种情况
      【解决方案3】:

      我不相信 listen 意味着有任何输出,我在ListenCommand 中看不到任何表明还有更多输出可以提供的东西。但是,当您向工匠寻求帮助时,它会建议您尝试--verbose (-v)

      php artisan queue:listen -v
      

      我对listen的理解是它被设计为作为后台服务运行,本质上是反复调用queue:work。如果您想测试工人是否在工作,您只需自己致电queue:work。你可能想看看在你的代码中添加一些logging,然后你就可以查看日志文件了。


      $ php artisan help queue:listen
      
      Usage:
       queue:listen [--queue[="..."]] [--delay[="..."]] [--memory[="..."]] [--timeout[="..."]] [connection]
      
      Arguments:
       connection            The name of connection
      
      Options:
       --queue               The queue to listen on
       --delay               Amount of time to delay failed jobs (default: 0)
       --memory              The memory limit in megabytes (default: 128)
       --timeout             Seconds a job may run before timing out (default: 60)
       --help (-h)           Display this help message.
       --quiet (-q)          Do not output any message.
       --verbose (-v)        Increase verbosity of messages.
       --version (-V)        Display this application version.
       --ansi                Force ANSI output.
       --no-ansi             Disable ANSI output.
       --no-interaction (-n) Do not ask any interactive question.
       --env                 The environment the command should run under.> 
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2019-07-03
        • 2019-08-20
        • 1970-01-01
        • 2014-05-07
        • 2018-06-20
        • 2016-10-07
        • 2014-08-09
        • 2018-08-12
        相关资源
        最近更新 更多