do_log() add uid and passkey

This commit is contained in:
xiaomlove
2021-03-03 11:42:05 +08:00
parent 7b8a6a7ce2
commit 25a69891f4
2 changed files with 5 additions and 6 deletions
+4 -1
View File
@@ -147,14 +147,17 @@ function dd($vars)
function do_log($log, $level = 'info')
{
global $CURUSER;
$logFile = getLogFile();
if (($fd = fopen($logFile, 'a')) !== false) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 2);
$content = sprintf(
"[%s] [%s] [%s] %s:%s %s%s%s %s%s",
"[%s] [%s] [%s] [%s] [%s] %s:%s %s%s%s %s%s",
date('Y-m-d H:i:s'),
$level,
defined('REQUEST_ID') ? REQUEST_ID : '',
$CURUSER['id'] ?? 0,
$CURUSER['passkey'] ?? $_REQUEST['passkey'] ?? '',
$backtrace[0]['file'] ?? '',
$backtrace[0]['line'] ?? '',
$backtrace[1]['class'] ?? '',