-
Notifications
You must be signed in to change notification settings - Fork 645
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
[5.x] Add exception context on failed jobs #1115
[5.x] Add exception context on failed jobs #1115
Conversation
This is a good pr but we'll need to make sure it's backwards compatible with existing horizon installations. To try this out, install an existing Laravel 8 app with current horizon, log a few jobs and afterwards update to your changes in the PR and log a few new jobs. Make sure the old ones still function. |
👋 @driesvints! I installed it on two existing and well-used Laravel 8 applications, and everything has been working like a charm for the past 5 days. It has been pretty useful for us to have the exception context directly in Horizon (like Telescope already does), rather than having to read it in the log file. |
Cool, thanks @antoinelame. Taylor will review this. |
Does this only work for custom exceptions in your application that define a |
Yep, it only works for exceptions that define a Do you think it's an issue? The idea is to unify the use of the
What do you think? |
This does not unify that though. Note that in Telescope the context is derived from the Logging system - where context can be applied globally to all logged messages. This PR only pulls context from the exception's |
Indeed, I see your point. I don't see a simple way to implement the functionality in the same way as Telescope, since Horizon doesn't rely on |
I don't think it's a bad PR and it might be better than nothing - just pointing out it's not quite the same as Telescope. |
Hi @antoinelame! An amazing addition to the ecosystem. I'm looking forward to using it. However struggling to find how exactly the context is added. I myself checked Laravel documentation - doesn't mention anything on the horizon page. I'd greatly appreciate if you throw an example job code or reference a documentation article! |
Hi @flexchar, you just have to declare the |
This PR adds the exception context when displaying a failed job.