Skip to content

Commit 06a4980

Browse files
authored
Merge pull request #1178 from sugenganthos/develop
Adjust log level to match RFC 5424
2 parents 60d017c + 0b3f5f8 commit 06a4980

3 files changed

Lines changed: 10 additions & 10 deletions

File tree

application/Config/Logger.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ class Logger extends BaseConfig
1818
| 2 = Alert Messages - Action Must Be Taken Immediately
1919
| 3 = Critical Messages - Application component unavailable, unexpected exception.
2020
| 4 = Runtime Errors - Don't need immediate action, but should be monitored.
21-
| 5 = Debug - Detailed debug information.
22-
| 6 = Warnings - Exceptional occurrences that are not errors.
23-
| 7 = Notices - Normal but significant events.
24-
| 8 = Info - Interesting events, like user logging in, etc.
21+
| 5 = Warnings - Exceptional occurrences that are not errors.
22+
| 6 = Notices - Normal but significant events.
23+
| 7 = Info - Interesting events, like user logging in, etc.
24+
| 8 = Debug - Detailed debug information.
2525
| 9 = All Messages
2626
|
2727
| You can also pass an array with threshold levels to show individual error types
2828
|
29-
| array(1, 2, 3, 5) = Emergency, Alert, Critical, and Debug messages
29+
| array(1, 2, 3, 8) = Emergency, Alert, Critical, and Debug messages
3030
|
3131
| For a live site you'll usually enable Critical or higher (3) to be logged otherwise
3232
| your log files will fill up very fast.

system/Log/Logger.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ class Logger implements LoggerInterface
7373
'alert' => 2,
7474
'critical' => 3,
7575
'error' => 4,
76-
'debug' => 5,
77-
'warning' => 6,
78-
'notice' => 7,
79-
'info' => 8,
76+
'warning' => 5,
77+
'notice' => 6,
78+
'info' => 7,
79+
'debug' => 8,
8080
];
8181

8282
/**

tests/system/Log/LoggerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ public function testLogLevels()
382382
$config = new LoggerConfig();
383383
$logger = new Logger($config);
384384

385-
$expected = 'DEBUG - ' . date('Y-m-d') . ' --> Test message';
385+
$expected = 'WARNING - ' . date('Y-m-d') . ' --> Test message';
386386

387387
$logger->log(5, 'Test message');
388388

0 commit comments

Comments
 (0)