You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1004 B
34 lines
1004 B
<?php
|
|
// 日志类
|
|
|
|
/**
|
|
* 记录三方日志
|
|
* @param mixed $param 入参
|
|
* @param mixed $result 出参
|
|
* @param string $type 三方接口类型,一般用"三方平台_接口功能_客户UID组成"
|
|
* @date 2021-01-22
|
|
*/
|
|
function platformLog($param = [], $result = [], $type = '')
|
|
{
|
|
$content = '[' . date("Y-m-d H:i:s") . '] ' .
|
|
'[url] ' . \think\facade\Request::url(true)
|
|
. "\r\n[type] " . $type;
|
|
\think\facade\Log::channel('platform')->write($content,'');
|
|
\think\facade\Log::channel('platform')->write("[param] ",'');
|
|
\think\facade\Log::channel('platform')->write($param,'');
|
|
\think\facade\Log::channel('platform')->write("[result] ",'');
|
|
\think\facade\Log::channel('platform')->write($result,'');
|
|
\think\facade\Log::channel('platform')->write("\r",'');
|
|
}
|
|
|
|
/**
|
|
* 记录原数据
|
|
* @param mixed $data 入参
|
|
* @date 2021-10-25
|
|
*/
|
|
function platformDataLog($data)
|
|
{
|
|
$content = $data;
|
|
\think\facade\Log::channel('platform')->info($content);
|
|
}
|