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

Issue with stderr logging #49927

Closed
yongtheskill opened this issue Jan 31, 2024 · 2 comments
Closed

Issue with stderr logging #49927

yongtheskill opened this issue Jan 31, 2024 · 2 comments

Comments

@yongtheskill
Copy link

Laravel Version

10.43.0

PHP Version

8.2.15

Database Driver & Version

No response

Description

When logging to stderr, certain strings will cause issues.

In handleProcessOutput of ServeCommand.php, the output is matched against certain strings. If these strings are found, additional logic is performed.
Here

If strings that match the criteria are logged, it is possible that the strings are not what is expected, and will cause an exception (See steps to reproduce.)

Steps To Reproduce

  1. Create a new laravel project
  2. In .env, change LOG_CHANNEL to stderr
  3. Add the following code such that will be run: Log::info(' Accepted:');
  4. An Undefined array key 1 exception will be thrown.

This is because the process output contains Accepted. This causes regex to be run to look for the port number after the colon. Since there is no port number, this fails and causes the exception. This is where it happens

Copy link

Thank you for reporting this issue!

As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub.

If possible, please make a pull request fixing the issue you have described, along with corresponding tests. All pull requests are promptly reviewed by the Laravel team.

Thank you!

@driesvints
Copy link
Member

Looks like we're not going to take action here right now, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants