Laravel Task Scheduler Error appendOutputTo

2019-06-19 17:14发布

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

标签: laravel-5.1
1条回答
地球回转人心会变
2楼-- · 2019-06-19 17:59

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-2015 as 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.

查看更多
登录 后发表回答