codelego/phpfox-log

phpfox框架的日志记录库。

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

This package is not auto-updated.

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


README

实现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

概念

  • 日志格式化器是一个可以以各种方式格式化消息的驱动程序。
  • 日志写入器是一个可以将日志消息写入不同目标的驱动程序。
  • 日志管理器是“Writer”的容器,对容器的任何调用都会影响所有

示例

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