A simple PSR-3 compliant logging class for PHP.
use Eurolink\Log\Logger;
$path = __DIR__ . '/logs';
$logger = new Logger($path);
$logger->info('Test info message.');
$logger->debug('Test debug message.');
The eight RFC 5424 levels of logs are supported, in cascading order:
Code | Severity | Description |
---|---|---|
0 | Emergency | System level failure (not application level) |
1 | Alert | Failure that requires immediate attention |
2 | Critical | Serious failure at the application level |
3 | Error | Runtime errors, used to log unhandled exceptions |
4 | Warning | May indicate that an error will occur if action is not taken |
5 | Notice | Events that are unusual but not error conditions |
6 | Info | Normal operational messages (no action required) |
7 | Debug | Verbose info useful to developers for debugging purposes (default) |
This project is licensed under the MIT license -- see the LICENSE
for the full license details.
Some inspiration has been taken from the following projects: