Skip to content

Commit

Permalink
[2.x] Fixes logging when using FPM (#154)
Browse files Browse the repository at this point in the history
* Fixes logging from stderr

* Adds missing import

* Adds missing message

* log cli errors

* Reverts

* Apply fixes from StyleCI

---------

Co-authored-by: Joe Dixon <hello@joedixon.co.uk>
Co-authored-by: StyleCI Bot <bot@styleci.io>
  • Loading branch information
3 people authored May 19, 2023
1 parent 4f8b57d commit 7a42ef1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Runtime/Fpm/Fpm.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ function_exists('__vapor_debug') && __vapor_debug('Starting FPM Process...');
$this->fpm->disableOutput()
->setTimeout(null)
->start(function ($type, $output) {
function_exists('__vapor_debug') && __vapor_debug($output);
fwrite(STDERR, $output.PHP_EOL);
});

$this->ensureFpmHasStarted();
Expand Down
2 changes: 1 addition & 1 deletion src/Runtime/Handlers/CliHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function handle(array $event)
if (! Str::containsAll($line, ['{"message":', '"level":'])) {
$output .= $line;
} else {
function_exists('__vapor_debug') && __vapor_debug($line);
echo $line.PHP_EOL;
}
});

Expand Down

0 comments on commit 7a42ef1

Please sign in to comment.