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

[1.x] Fix Swoole breaks when log is a valid JSON #316

Merged
merged 1 commit into from
Jun 10, 2021
Merged

[1.x] Fix Swoole breaks when log is a valid JSON #316

merged 1 commit into from
Jun 10, 2021

Conversation

henriquebremenkanp
Copy link
Contributor

@henriquebremenkanp henriquebremenkanp commented Jun 10, 2021

The swoole server acknowledges a log entry as something else (a request I guess) and routes it to handleStream when the log entry is a valid JSON.

I don't know if there is any other better way to solve it, but when receiving a json before routing it to handleStream, adding a check for the required type key as well at least solves the issue for the format in Monolog\Formatter\JsonFormatter

It would still conflict with other logs that:

  1. Are valid json
  2. Contains the key type

@driesvints
Copy link
Member

Please read the pr description before submitting and post a thorough explanation what this fixes. Don't just link to an issue. Thanks.

@henriquebremenkanp henriquebremenkanp changed the title Fix #315 Fix #315 - Swoole breaks when log is a valid JSON Jun 10, 2021
@henriquebremenkanp
Copy link
Contributor Author

@driesvints Sorry, just updated it

@driesvints driesvints changed the title Fix #315 - Swoole breaks when log is a valid JSON [1.x] Fix Swoole breaks when log is a valid JSON Jun 10, 2021
@driesvints driesvints linked an issue Jun 10, 2021 that may be closed by this pull request
@taylorotwell taylorotwell merged commit 411cef2 into laravel:1.x Jun 10, 2021
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.

Logs formatted as valid json breaks octane
4 participants