Skip to content

Fix php:logs 404 by using the correct Forge log key - #177

Open
19singh96sunny-max wants to merge 1 commit into
laravel:2.xfrom
19singh96sunny-max:fix/php-logs-key
Open

19singh96sunny-max wants to merge 1 commit into
laravel:2.xfrom
19singh96sunny-max:fix/php-logs-key

Conversation

@19singh96sunny-max

Copy link
Copy Markdown

Fixes #175.

php:logs requests the server log using PhpVersion::forgeKey(), which returns php84. Forge's log endpoint expects the hyphenated key php-8.4 (consistent with the existing nginx-error and database-mysql log keys), so the request 404s.

This adds a dedicated PhpVersion::logKey() returning php-{release} and uses it in PhpLogsCommand. forgeKey() is intentionally left unchanged, since php:restart relies on the php84 form for the reboot endpoint.

Added a logKey() unit test and updated the php:logs feature test to assert the corrected key.

The php:logs command requested the server log with forgeKey() (e.g. "php84"),
but Forge's log endpoint expects the hyphenated key "php-8.4" — matching the
existing "nginx-error" and "database-mysql" log keys — and returns a 404
otherwise.

Add a dedicated PhpVersion::logKey() that returns "php-{release}" and use it in
PhpLogsCommand. forgeKey() is left unchanged because php:restart still relies on
the "php84" form for the PHP reboot endpoint.
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.

php:logs returns 404 because it requests log key "php84" instead of "php-8.4"

1 participant