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