mirror of
https://github.com/dunglas/frankenphp.git
synced 2025-12-24 13:38:11 +08:00
feat: add support for structured logging with the frankenphp_log() PHP function (#1979)
As discussed in https://github.com/php/frankenphp/discussions/1961, there is no real way to pass a severity/level to any log handler offered by PHP that would make it to the FrankenPHP layer. This new function allows applications embedding FrankenPHP to integrate PHP logging into the application itself, thus offering a more streamlined experience. --------- Co-authored-by: Quentin Burgess <qutn.burgess@gmail.com> Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>
This commit is contained in:
20
testdata/worker-getopt.php
vendored
20
testdata/worker-getopt.php
vendored
@@ -3,17 +3,17 @@
|
||||
do {
|
||||
$ok = frankenphp_handle_request(function (): void {
|
||||
print_r($_SERVER);
|
||||
|
||||
if (!isset($_SERVER['HTTP_REQUEST'])) {
|
||||
exit(1);
|
||||
}
|
||||
if (isset($_SERVER['FRANKENPHP_WORKER'])) {
|
||||
exit(2);
|
||||
}
|
||||
if (isset($_SERVER['FOO'])) {
|
||||
exit(3);
|
||||
}
|
||||
});
|
||||
|
||||
getopt('abc');
|
||||
|
||||
if (!isset($_SERVER['HTTP_REQUEST'])) {
|
||||
exit(1);
|
||||
}
|
||||
if (isset($_SERVER['FRANKENPHP_WORKER'])) {
|
||||
exit(2);
|
||||
}
|
||||
if (isset($_SERVER['FOO'])) {
|
||||
exit(3);
|
||||
}
|
||||
} while ($ok);
|
||||
|
||||
Reference in New Issue
Block a user