diff --git a/lib/private/backgroundjob/job.php b/lib/private/backgroundjob/job.php index 677b37e929..4c4da94d4f 100644 --- a/lib/private/backgroundjob/job.php +++ b/lib/private/backgroundjob/job.php @@ -52,7 +52,7 @@ abstract class Job implements IJob { $this->run($this->argument); } catch (\Exception $e) { if ($logger) { - $logger->error('Error while running background job: ' . $e->getMessage()); + $logger->error('Error while running background job (class: ' . get_class($this) . ', arguments: ' . print_r($this->argument, true) . '): ' . $e->getMessage()); } } } diff --git a/tests/lib/backgroundjob/job.php b/tests/lib/backgroundjob/job.php index 912e0e13b5..f2a5ff894f 100644 --- a/tests/lib/backgroundjob/job.php +++ b/tests/lib/backgroundjob/job.php @@ -28,7 +28,7 @@ class Job extends \Test\TestCase { ->getMock(); $logger->expects($this->once()) ->method('error') - ->with('Error while running background job: '); + ->with('Error while running background job (class: Test\BackgroundJob\TestJob, arguments: ): '); $this->assertCount(1, $jobList->getAll()); $job->execute($jobList, $logger);