Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log context for Job Batch Callables #2

Open
bilfeldt opened this issue Sep 27, 2023 · 0 comments
Open

Log context for Job Batch Callables #2

bilfeldt opened this issue Sep 27, 2023 · 0 comments

Comments

@bilfeldt
Copy link
Owner

bilfeldt commented Sep 27, 2023

The Correlation ID, Request ID and Client Request ID is currently added to each queued jobs payload and added to log context when the job is being processed. This works both with queued jobs, job chains and job batches.

Unfortunately I have not found a way to do this with the callables that can be used with job batches:

Bus::batch([
    new FirstJob(),
    new SecondJob(),
])->then(function (Batch $batch) {
    Log::debug('Then: All jobs completed successfully...'); // No context unfortunately
})->catch(function (Batch $batch, Throwable $e) {
    Log::debug('Catch: First batch job failure detected...'); // No context unfortunately
})->finally(function (Batch $batch) {
    Log::debug('Finally: The batch has finished executing...'); // No context unfortunately
})
    ->allowFailures()
    ->dispatch();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant