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

[9.x] Add configurable timezone support for WorkCommand output timestamps #45722

Merged

Conversation

trm42
Copy link
Contributor

@trm42 trm42 commented Jan 19, 2023

Introduces a new configuration option queue.log_timezone, so that the php artisan queue:work command can output the timestamps in a different timezone than the in application default app.timezone.

The rationale for this addition is that this is already doable for log files made through Log facade with Log::setTimezone but the WorkCommand is not using the Logging subsystem but Console\OutputStyle to write directly back to the stdout and stderr.

When we're pushing the logs from the php artisan queue:work to a logging service like AWS Cloudwatch, it expects the timestamps to be in UTC but the previously used application default timezone can be something else leading to discrepancy between Log::'ed log files and console command output. In this specific case Cloudwatch isn't too happy about timestamps happening in the future.

The configuration has been added as optional. If it has not been defined, the code uses the current application timezone.

trm42 and others added 3 commits January 19, 2023 14:18
…output timestamp timezone with optional configuration key 'queue.log_timezone'
@taylorotwell taylorotwell merged commit 05546bf into laravel:9.x Jan 19, 2023
@trm42 trm42 deleted the queue-work-configurable-timestamp-timezone branch January 20, 2023 05:49
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

Successfully merging this pull request may close these issues.

None yet

2 participants