From acecb0d0388075ca47b9fcfb00b524212f171061 Mon Sep 17 00:00:00 2001 From: sugenganthos Date: Fri, 24 Aug 2018 15:28:58 +0700 Subject: [PATCH 1/3] Update Logger.php Change log level number to match RFC 5424. Enabling threshold on 'debug' level is same as show all messages. This is what developer wants on debugging stage --- system/Log/Logger.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/system/Log/Logger.php b/system/Log/Logger.php index c433e0e181b6..37c9b08a766c 100644 --- a/system/Log/Logger.php +++ b/system/Log/Logger.php @@ -73,10 +73,10 @@ class Logger implements LoggerInterface 'alert' => 2, 'critical' => 3, 'error' => 4, - 'debug' => 5, - 'warning' => 6, - 'notice' => 7, - 'info' => 8, + 'warning' => 5, + 'notice' => 6, + 'info' => 7, + 'debug' => 8, ]; /** From 2832ac7a84edb1be741db4d5498ce193e1bc5044 Mon Sep 17 00:00:00 2001 From: sugenganthos Date: Fri, 24 Aug 2018 15:31:44 +0700 Subject: [PATCH 2/3] Update Logger.php --- application/Config/Logger.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/application/Config/Logger.php b/application/Config/Logger.php index 5a71085b2156..8b64f88b586b 100644 --- a/application/Config/Logger.php +++ b/application/Config/Logger.php @@ -18,15 +18,15 @@ class Logger extends BaseConfig | 2 = Alert Messages - Action Must Be Taken Immediately | 3 = Critical Messages - Application component unavailable, unexpected exception. | 4 = Runtime Errors - Don't need immediate action, but should be monitored. - | 5 = Debug - Detailed debug information. - | 6 = Warnings - Exceptional occurrences that are not errors. - | 7 = Notices - Normal but significant events. - | 8 = Info - Interesting events, like user logging in, etc. + | 5 = Warnings - Exceptional occurrences that are not errors. + | 6 = Notices - Normal but significant events. + | 7 = Info - Interesting events, like user logging in, etc. + | 8 = Debug - Detailed debug information. | 9 = All Messages | | You can also pass an array with threshold levels to show individual error types | - | array(1, 2, 3, 5) = Emergency, Alert, Critical, and Debug messages + | array(1, 2, 3, 8) = Emergency, Alert, Critical, and Debug messages | | For a live site you'll usually enable Critical or higher (3) to be logged otherwise | your log files will fill up very fast. From 0b3f5f8da730c6842b29b51313a2cc4b5b316870 Mon Sep 17 00:00:00 2001 From: sugenganthos Date: Mon, 27 Aug 2018 11:48:24 +0700 Subject: [PATCH 3/3] Update LoggerTest.php --- tests/system/Log/LoggerTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/system/Log/LoggerTest.php b/tests/system/Log/LoggerTest.php index da8de297fa28..fb54ac548aef 100644 --- a/tests/system/Log/LoggerTest.php +++ b/tests/system/Log/LoggerTest.php @@ -382,7 +382,7 @@ public function testLogLevels() $config = new LoggerConfig(); $logger = new Logger($config); - $expected = 'DEBUG - ' . date('Y-m-d') . ' --> Test message'; + $expected = 'WARNING - ' . date('Y-m-d') . ' --> Test message'; $logger->log(5, 'Test message');