更新依赖库,新增数据库日志驱动;修改说明;

This commit is contained in:
augushong
2021-07-24 23:05:22 +08:00
parent 89d3840552
commit 1a132b1be9
9 changed files with 184 additions and 57 deletions

1
extend/.gitignore vendored
View File

@@ -1,2 +1 @@
*
!.gitignore

View File

@@ -0,0 +1,32 @@
<?php
namespace think\log\driver;
use app\model\DebugLog;
use think\contract\LogHandlerInterface;
use think\facade\Log;
class DebugMysql implements LogHandlerInterface
{
public function save(array $log): bool
{
$create_time = time();
$create_time_title = date('Y-m-d H:i:s', $create_time);
foreach ($log as $log_level => $log_list) {
foreach ($log_list as $key => $log_item) {
DebugLog::create([
'level' => $log_level,
'content' => $log_item,
'create_time' => $create_time,
'create_time_title' => $create_time_title,
]);
}
}
return true;
}
}