codelego/phpfox-log

Logging library for phpfox framework.

dev-master 2016-11-29 10:43 UTC

This package is not auto-updated.

Last update: 2024-09-28 19:58:18 UTC


README

Implement http://www.php-fig.org/psr/psr-3/

https://tools.ietf.org/html/rfc3164

Code    Level      Meaning
0       Emergency  system is unusable
1       Alert      action must be taken immediately
2       Critical   critical conditions
3       Error      error conditions
4       Warning    warning conditions
5       Notice     normal but significant condition
6       Info       informational messages
7       Debug      Debug-level messages

Concepts

  • Log Formater is a driver to format message in various way.
  • Log Writer is a driver to write log message to difference target.
  • Log Manager is a container of "Writer", any invoke to Container will affected to all

Example

$logContainer->add(new FilesystemWriter([...]));
$logContainer->add(new DatabaseWriter([...]));
$logContainer->debug('system unnable');
//result: write to database & file system