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