mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
refactor: 规范MysqlLogger代码
This commit is contained in:
parent
907ccebfdf
commit
bc80d7e91c
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user