2016-08-08 12:17:14 +03:00
|
|
|
<?php
|
2017-10-12 11:13:20 +03:00
|
|
|
declare(strict_types=1);
|
|
|
|
|
2018-10-20 13:37:26 +03:00
|
|
|
namespace Shlinkio\Shlink;
|
|
|
|
|
2016-08-08 12:56:19 +03:00
|
|
|
use Monolog\Handler\RotatingFileHandler;
|
2018-11-24 11:29:51 +03:00
|
|
|
use Monolog\Handler\StreamHandler;
|
2016-08-08 12:56:19 +03:00
|
|
|
use Monolog\Logger;
|
2018-10-20 13:37:26 +03:00
|
|
|
use Monolog\Processor;
|
2019-02-27 00:56:43 +03:00
|
|
|
|
2018-10-20 13:37:26 +03:00
|
|
|
use const PHP_EOL;
|
2016-08-08 12:56:19 +03:00
|
|
|
|
2016-08-08 12:17:14 +03:00
|
|
|
return [
|
|
|
|
|
|
|
|
'logger' => [
|
2016-08-08 12:56:19 +03:00
|
|
|
'formatters' => [
|
|
|
|
'dashed' => [
|
2018-10-20 13:37:26 +03:00
|
|
|
'format' => '[%datetime%] %channel%.%level_name% - %message%' . PHP_EOL,
|
2016-08-08 12:56:19 +03:00
|
|
|
'include_stacktraces' => true,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'handlers' => [
|
2018-11-25 19:14:03 +03:00
|
|
|
'shlink_rotating_handler' => [
|
2016-08-08 12:56:19 +03:00
|
|
|
'class' => RotatingFileHandler::class,
|
|
|
|
'level' => Logger::INFO,
|
|
|
|
'filename' => 'data/log/shlink_log.log',
|
2018-11-24 11:29:51 +03:00
|
|
|
'max_files' => 30,
|
2018-11-25 19:14:03 +03:00
|
|
|
'formatter' => 'dashed',
|
|
|
|
],
|
|
|
|
'swoole_access_handler' => [
|
|
|
|
'class' => StreamHandler::class,
|
|
|
|
'level' => Logger::INFO,
|
|
|
|
'stream' => 'php://stdout',
|
2016-08-08 12:56:19 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2018-10-20 13:37:26 +03:00
|
|
|
'processors' => [
|
|
|
|
'exception_with_new_line' => [
|
|
|
|
'class' => Common\Logger\Processor\ExceptionWithNewLineProcessor::class,
|
|
|
|
],
|
|
|
|
'psr3' => [
|
|
|
|
'class' => Processor\PsrLogMessageProcessor::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
2016-08-08 12:17:14 +03:00
|
|
|
'loggers' => [
|
|
|
|
'Shlink' => [
|
2018-11-25 19:14:03 +03:00
|
|
|
'handlers' => ['shlink_rotating_handler'],
|
2018-10-20 13:37:26 +03:00
|
|
|
'processors' => ['exception_with_new_line', 'psr3'],
|
2016-08-08 12:17:14 +03:00
|
|
|
],
|
2018-11-25 19:14:03 +03:00
|
|
|
'Swoole' => [
|
|
|
|
'handlers' => ['swoole_access_handler'],
|
|
|
|
'processors' => ['psr3'],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'dependencies' => [
|
|
|
|
'factories' => [
|
|
|
|
'Logger_Shlink' => Common\Factory\LoggerFactory::class,
|
|
|
|
'Logger_Swoole' => Common\Factory\LoggerFactory::class,
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
'zend-expressive-swoole' => [
|
|
|
|
'swoole-http-server' => [
|
|
|
|
'logger' => [
|
2018-12-05 23:26:19 +03:00
|
|
|
'logger-name' => 'Logger_Swoole',
|
2018-11-25 19:14:03 +03:00
|
|
|
],
|
2016-08-08 12:17:14 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
];
|