Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust log level to match RFC 5424 #1178

Merged
merged 3 commits into from
Sep 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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