Skip to content

Commit

Permalink
Merge pull request #1178 from sugenganthos/develop
Browse files Browse the repository at this point in the history
Adjust log level to match RFC 5424
  • Loading branch information
lonnieezell authored Sep 4, 2018
2 parents 60d017c + 0b3f5f8 commit 06a4980
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions application/Config/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
8 changes: 4 additions & 4 deletions system/Log/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
];

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/system/Log/LoggerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit 06a4980

Please sign in to comment.