mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Updated how monolog handlers are registered so that it is possible to overwrite them via local config
This commit is contained in:
parent
4401824716
commit
5d76a55c46
3 changed files with 11 additions and 9 deletions
|
@ -48,7 +48,10 @@ return [
|
|||
|
||||
'loggers' => [
|
||||
'Shlink' => [
|
||||
'handlers' => ['shlink_rotating_handler'],
|
||||
'handlers' => [
|
||||
// Using a key allows for this to be overwritten
|
||||
'shlink_handler' => 'shlink_rotating_handler',
|
||||
],
|
||||
'processors' => ['exception_with_new_line', 'psr3'],
|
||||
],
|
||||
'Access' => [
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Monolog\Handler\StreamHandler;
|
||||
|
@ -9,9 +10,6 @@ $isSwoole = extension_loaded('swoole');
|
|||
// For swoole, send logs to standard output
|
||||
$logger = $isSwoole ? [
|
||||
'handlers' => [
|
||||
'shlink_rotating_handler' => [
|
||||
'level' => Logger::EMERGENCY, // This basically disables regular file logs
|
||||
],
|
||||
'shlink_stdout_handler' => [
|
||||
'class' => StreamHandler::class,
|
||||
'level' => Logger::DEBUG,
|
||||
|
@ -22,7 +20,9 @@ $logger = $isSwoole ? [
|
|||
|
||||
'loggers' => [
|
||||
'Shlink' => [
|
||||
'handlers' => ['shlink_stdout_handler'],
|
||||
'handlers' => [
|
||||
'shlink_handler' => 'shlink_stdout_handler',
|
||||
],
|
||||
],
|
||||
],
|
||||
] : [
|
||||
|
|
|
@ -131,9 +131,6 @@ return [
|
|||
|
||||
'logger' => [
|
||||
'handlers' => [
|
||||
'shlink_rotating_handler' => [
|
||||
'level' => Logger::EMERGENCY, // This basically disables regular file logs
|
||||
],
|
||||
'shlink_stdout_handler' => [
|
||||
'class' => StreamHandler::class,
|
||||
'level' => Logger::INFO,
|
||||
|
@ -144,7 +141,9 @@ return [
|
|||
|
||||
'loggers' => [
|
||||
'Shlink' => [
|
||||
'handlers' => ['shlink_stdout_handler'],
|
||||
'handlers' => [
|
||||
'shlink_handler' => 'shlink_stdout_handler',
|
||||
],
|
||||
],
|
||||
],
|
||||
],
|
||||
|
|
Loading…
Add table
Reference in a new issue