shlink/config/autoload/logger.global.php

55 lines
1.3 KiB
PHP
Raw Normal View History

<?php
2019-10-05 18:26:10 +03:00
2017-10-12 11:13:20 +03:00
declare(strict_types=1);
namespace Shlinkio\Shlink;
2022-06-04 09:59:17 +03:00
use Monolog\Level;
use Monolog\Logger;
2020-02-19 21:37:47 +03:00
use PhpMiddleware\RequestId;
use Psr\Log\LoggerInterface;
2022-06-04 09:59:17 +03:00
use Shlinkio\Shlink\Common\Logger\LoggerFactory;
use Shlinkio\Shlink\Common\Logger\LoggerType;
2022-06-04 09:59:17 +03:00
$common = [
'level' => Level::Info->value,
'processors' => [RequestId\MonologProcessor::class],
'line_format' => '[%datetime%] [%extra.request_id%] %channel%.%level_name% - %message%',
];
return [
'logger' => [
'Shlink' => [
2022-06-04 09:59:17 +03:00
'type' => LoggerType::FILE->value,
...$common,
],
'Access' => [
2022-06-04 09:59:17 +03:00
'type' => LoggerType::STREAM->value,
...$common,
],
],
'dependencies' => [
'factories' => [
2022-06-04 09:59:17 +03:00
'Logger_Shlink' => [LoggerFactory::class, 'Shlink'],
'Logger_Access' => [LoggerFactory::class, 'Access'],
],
'aliases' => [
'logger' => 'Logger_Shlink',
Logger::class => 'Logger_Shlink',
LoggerInterface::class => 'Logger_Shlink',
],
],
2020-01-01 23:11:53 +03:00
'mezzio-swoole' => [
'swoole-http-server' => [
'logger' => [
2019-05-13 20:16:14 +03:00
'logger-name' => 'Logger_Access',
'format' => '%u "%r" %>s %B',
],
],
],
];