codeages/biz-targetlog

v0.2.1 2017-02-08 06:41 UTC

This package is auto-updated.

Last update: 2024-04-06 15:00:48 UTC


README

** 此项目已合并入Biz Framework **,请移步至: https://github.com/codeages/biz-framework

Build Status

一个日志类,用于针对某个对象记录日志的类,日志存储到数据库,便于查询检索。

使用说明

创建了针对标识为{example-1}对象的日志类:

$logger = new Targetlogger('example', 1);

记录日志:

$context = array('user_id' => 1, 'action' => 'some_action', 'ip' => '127.0.0.1');
$logger->debug('something happen', $context);

其中$context为可选参数,$context中的各个key也是可选。如果$context中的key传入了user_id, action, ip则会当做字段记录,可被检索。