2016-08-08 04:56:19 -05:00
|
|
|
<?php
|
2019-11-30 02:28:09 -06:00
|
|
|
|
2018-11-24 02:29:51 -06:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2019-07-23 09:36:56 -05:00
|
|
|
use Monolog\Handler\StreamHandler;
|
2016-08-08 04:56:19 -05:00
|
|
|
use Monolog\Logger;
|
|
|
|
|
2021-12-05 03:08:10 -06:00
|
|
|
$isSwoole = extension_loaded('openswoole');
|
2019-07-23 09:36:56 -05:00
|
|
|
|
|
|
|
// For swoole, send logs to standard output
|
2019-11-30 10:59:04 -06:00
|
|
|
$handler = $isSwoole
|
|
|
|
? [
|
|
|
|
'name' => StreamHandler::class,
|
|
|
|
'params' => [
|
2019-07-23 10:07:40 -05:00
|
|
|
'level' => Logger::DEBUG,
|
2019-07-23 09:36:56 -05:00
|
|
|
'stream' => 'php://stdout',
|
|
|
|
],
|
2019-11-30 10:59:04 -06:00
|
|
|
]
|
|
|
|
: [
|
|
|
|
'params' => [
|
|
|
|
'level' => Logger::DEBUG,
|
|
|
|
],
|
|
|
|
];
|
2016-08-08 04:56:19 -05:00
|
|
|
|
2019-11-30 10:59:04 -06:00
|
|
|
return [
|
|
|
|
|
|
|
|
'logger' => [
|
2019-07-23 09:36:56 -05:00
|
|
|
'Shlink' => [
|
2019-11-30 02:28:09 -06:00
|
|
|
'handlers' => [
|
2019-11-30 10:59:04 -06:00
|
|
|
'shlink_handler' => $handler,
|
2019-11-30 02:28:09 -06:00
|
|
|
],
|
2016-08-08 04:56:19 -05:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
];
|