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;
|
|
|
|
use Monolog\Logger;
|
2018-10-20 13:37:26 +03:00
|
|
|
use Monolog\Processor;
|
|
|
|
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' => [
|
|
|
|
'rotating_file_handler' => [
|
|
|
|
'class' => RotatingFileHandler::class,
|
|
|
|
'level' => Logger::INFO,
|
|
|
|
'filename' => 'data/log/shlink_log.log',
|
|
|
|
'max_files' => 30,
|
|
|
|
'formatter' => 'dashed',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
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' => [
|
2016-08-08 12:56:19 +03:00
|
|
|
'handlers' => ['rotating_file_handler'],
|
2018-10-20 13:37:26 +03:00
|
|
|
'processors' => ['exception_with_new_line', 'psr3'],
|
2016-08-08 12:17:14 +03:00
|
|
|
],
|
|
|
|
],
|
|
|
|
],
|
|
|
|
|
|
|
|
];
|