From bc80d7e91cea441b0d4a3f11d34f83b467a4b0de Mon Sep 17 00:00:00 2001 From: xboard Date: Mon, 20 Nov 2023 09:37:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=A7=84=E8=8C=83MysqlLogger?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Logging/MysqlLoggerHandler.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/Logging/MysqlLoggerHandler.php b/app/Logging/MysqlLoggerHandler.php index e73e55b..dfe178a 100644 --- a/app/Logging/MysqlLoggerHandler.php +++ b/app/Logging/MysqlLoggerHandler.php @@ -31,15 +31,15 @@ class MysqlLoggerHandler extends AbstractProcessingHandler 'ip' => request()->getClientIp(), 'data' => json_encode($record['request_data']) , 'context' => isset($record['context']) ? json_encode($record['context']) : '', - 'created_at' => strtotime($record['datetime']), - 'updated_at' => strtotime($record['datetime']), + 'created_at' => $record['datetime']->getTimestamp(), + 'updated_at' => $record['datetime']->getTimestamp(), ]; LogModel::insert( $log ); }catch (\Exception $e){ - Log::channel('daily')->error($e->getMessage().$e->getFile().$e->getTraceAsString()); + // Log::channel('daily')->error($e->getMessage().$e->getFile().$e->getTraceAsString()); } } }