Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordiosmosis <diosmosis@users.noreply.github.com>2018-12-19 03:14:21 +0300
committerGitHub <noreply@github.com>2018-12-19 03:14:21 +0300
commit1b895a35fe13e2d25331e8a5b0c57cbdd6497384 (patch)
tree0cf85d033d4b84c39c786ac1e93de848a7ae8d10 /plugins/Monolog
parent0a2d0ea1ede1024f5a556cf5e776e5033c1d1308 (diff)
Allow setting different log levels per log writer if desired. (#13873)
* Set different log levels per log writer if desired. * small tweak * tweak doc
Diffstat (limited to 'plugins/Monolog')
-rw-r--r--plugins/Monolog/config/config.php36
1 files changed, 33 insertions, 3 deletions
diff --git a/plugins/Monolog/config/config.php b/plugins/Monolog/config/config.php
index 04cd1dc21c..19e7752479 100644
--- a/plugins/Monolog/config/config.php
+++ b/plugins/Monolog/config/config.php
@@ -46,18 +46,18 @@ return array(
),
'Piwik\Plugins\Monolog\Handler\FileHandler' => DI\object()
- ->constructor(DI\get('log.file.filename'), DI\get('log.level'))
+ ->constructor(DI\get('log.file.filename'), DI\get('log.level.file'))
->method('setFormatter', DI\get('log.lineMessageFormatter.file')),
'log.lineMessageFormatter.file' => DI\object('Piwik\Plugins\Monolog\Formatter\LineMessageFormatter')
->constructorParameter('allowInlineLineBreaks', false),
'Piwik\Plugins\Monolog\Handler\DatabaseHandler' => DI\object()
- ->constructor(DI\get('log.level'))
+ ->constructor(DI\get('log.level.database'))
->method('setFormatter', DI\get('Piwik\Plugins\Monolog\Formatter\LineMessageFormatter')),
'Piwik\Plugins\Monolog\Handler\WebNotificationHandler' => DI\object()
- ->constructor(DI\get('log.level'))
+ ->constructor(DI\get('log.level.screen'))
->method('setFormatter', DI\get('Piwik\Plugins\Monolog\Formatter\LineMessageFormatter')),
'log.level' => DI\factory(function (ContainerInterface $c) {
@@ -70,6 +70,36 @@ return array(
return Logger::WARNING;
}),
+ 'log.level.file' => DI\factory(function (ContainerInterface $c) {
+ if ($c->has('ini.log.log_level_file')) {
+ $level = Log::getMonologLevelIfValid($c->get('ini.log.log_level_file'));
+ if ($level !== null) {
+ return $level;
+ }
+ }
+ return $c->get('log.level');
+ }),
+
+ 'log.level.screen' => DI\factory(function (ContainerInterface $c) {
+ if ($c->has('ini.log.log_level_screen')) {
+ $level = Log::getMonologLevelIfValid($c->get('ini.log.log_level_screen'));
+ if ($level !== null) {
+ return $level;
+ }
+ }
+ return $c->get('log.level');
+ }),
+
+ 'log.level.database' => DI\factory(function (ContainerInterface $c) {
+ if ($c->has('ini.log.log_level_database')) {
+ $level = Log::getMonologLevelIfValid($c->get('ini.log.log_level_database'));
+ if ($level !== null) {
+ return $level;
+ }
+ }
+ return $c->get('log.level');
+ }),
+
'log.file.filename' => DI\factory(function (ContainerInterface $c) {
$logPath = $c->get('ini.log.logger_file_path');