-
Notifications
You must be signed in to change notification settings - Fork 11k
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
[11.x] Add --json
flag to queue:work
command for structured logging
#52887
[11.x] Add --json
flag to queue:work
command for structured logging
#52887
Conversation
Proposed ImprovementsWould you like me to update the PR with these suggestions? 1. Introduce
|
3. Add Exception to
|
This throws errors when running
Also reported in #53071 |
This PR introduces a new
--json
flag for thequeue:work
command, enabling structured JSON output for enhanced observability.Motivation
Why not?
Monolog\Formatter\JsonFormatter
.JSON output format
The JSON output continues to include two log entries per job: one at the start and another at completion.
Key fields include:
timestamp
: Datetime in ISO 8601 format.level
: PSR-3 log levelinfo
orwarning
. It helps monitoring tools.status
: Current execution status ofqueue:work
command:starting
,success
,released_after_exception
orfailed
.result
: Outcome of completed jobs:deleted
,released
orfailed
.duration
: In seconds.exception
: FQCN of the Exception.message
: Exception message.Sucessful Job
Failed Job
Job Starting
Open Questions
-v
argument to control the verbosity of the JSON output?