改进日志存储结构和输出驱动

This commit is contained in:
thinkphp
2016-06-06 14:22:37 +08:00
parent 486e58975b
commit 0efb5d02fd
5 changed files with 62 additions and 48 deletions

View File

@@ -77,7 +77,7 @@ class Log
if (!is_string($msg)) {
$msg = var_export($msg, true);
}
self::$log[] = ['type' => $type, 'msg' => $msg];
self::$log[$type][] = $msg;
}
/**
@@ -123,7 +123,7 @@ class Log
$msg = var_export($msg, true);
}
// 封装日志信息
$log[] = ['type' => $type, 'msg' => $msg];
$log[$type][] = $msg;
// 监听log_write
Hook::listen('log_write', $log);