Scheduler错误appendOutputTo

Scheduler错误appendOutputTo

本文介绍了Laravel Task Scheduler错误appendOutputTo的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Console/Kernal

中添加了以下行

protected function schedule(Schedule $schedule)
{
    $schedule->command('queue:work')
             ->everyMinute()
             ->appendOutputTo($filePath);
}

然后在cmd提示符下,我运行了以下artisan命令以运行计划的任务,但出现以下错误

php artisan schedule:run

错误:

 [Symfony\Component\Debug\Exception\FatalErrorException]
 Call to undefined method Illuminate\Console\Scheduling\Event::appendOutputTo()

与当我使用->sendOutputTo($filename)时一样,它工作正常,当然它不会追加但会覆盖文件.

谢谢

K

解决方案

是的,我是对的,Laravel 5.1中不存在appendOutputTo().

好消息是它将在Laravel 5.2中提供

laravel-news-

更新:2015年12月10日如sstarlight所述,我重新检查(搜索了appendOutputTo函数),是的,它现在在vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php中存在,与以前不同.谢谢laravel和sstarlight,让我们知道.

I added following line in Console/Kernal

protected function schedule(Schedule $schedule)
{
    $schedule->command('queue:work')
             ->everyMinute()
             ->appendOutputTo($filePath);
}

Then in cmd prompt I ran the following artisan command to run the scheduled tasks but I get following error

php artisan schedule:run

Error:

 [Symfony\Component\Debug\Exception\FatalErrorException]
 Call to undefined method Illuminate\Console\Scheduling\Event::appendOutputTo()

Where as when I use ->sendOutputTo($filename) instead it works fine, of course it doesn't append but overwrite a file.

Thanks,

K

解决方案

Yes, I was right, appendOutputTo() isn't present in Laravel 5.1.

Good news is it will be available in Laravel 5.2

laravel-news-5.2-whats-coming

Update: 10-Dec-2015as sstarlight mentioned, and I rechecked (searched for appendOutputTo function), and yes it is now present in vendor/laravel/framework/src/Illuminate/Console/Scheduling/Event.php unlike before.Thanks laravel and thanks sstarlight to let us know.

这篇关于Laravel Task Scheduler错误appendOutputTo的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 07:05