t0berius's avatar

disable logging failed jobs

How can I disable the logging of failed jobs in laravel? Doc only provided this: https://laravel.com/docs/5.3/queues#dealing-with-failed-jobs

But all in all I don't need to log any failed jobs, so my laravel.log file is containing sometimes errors, because the failed jobs table doesn't exist, but as I said, I don't need to log them.

0 likes
1 reply
AlbinoDrought's avatar

I wanted to do the same thing, so I went on an adventure.

Somewhere along the line, the thing that stores failed jobs to the DB is registered (QueueServiceProvider->registerFailedJobServices)

This has the nice, probably-undocumented ternary statement:

if a queue.failed table is set, send failed jobs to the db. Otherwise, just ignore them (QueueServiceProvider line 199, as of Feb 5 2018)

So, to disable this functionality, and avoid the errors in your log file, set 'failed.table' to null in your config/queue.php. (By default, it's set to failed_jobs).

4 likes

Please or to participate in this conversation.