|
|
@@ -60,18 +60,19 @@ class LogService
|
|
|
while (Redis::LLEN('LOGS') > 0) {
|
|
|
$log = Redis::LPOP('LOGS');
|
|
|
$arr = json_decode($log);
|
|
|
- if ($length + strlen($arr->description) > 1024 * 512) {
|
|
|
+ $description = (is_string($arr->description)?$arr->description:json_encode($arr->description))??'';
|
|
|
+ if ($length + strlen($description) > 1024 * 512) {
|
|
|
Log::query()->insert($data);
|
|
|
$length = 0;
|
|
|
$data = [];
|
|
|
}
|
|
|
- $length = $length + strlen($arr->description);
|
|
|
+ $length = $length + strlen($description);
|
|
|
$data[] = [
|
|
|
'class' => $arr->class,
|
|
|
'id_user' => $arr->id_user,
|
|
|
'ip' => $arr->ip,
|
|
|
'method' => $arr->method,
|
|
|
- 'description' => $arr->description,
|
|
|
+ 'description' => $description,
|
|
|
'created_at' => $arr->created_at,
|
|
|
'updated_at' => $arr->updated_at,
|
|
|
];
|