lizhen 15 stundas atpakaļ
vecāks
revīzija
8880d4701a
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4 3
      application/common/controller/Api.php

+ 4 - 3
application/common/controller/Api.php

@@ -418,8 +418,9 @@ class Api
         $controllername = $this->request->controller();
         $controllername = $this->request->controller();
         $actionname     = $this->request->action();
         $actionname     = $this->request->action();
 
 
-        if(strtolower($actionname) == 'callback'){
-            return true;
+        $path = 'Api/';
+        if(strtolower($actionname) == 'test'){
+            $path = 'Test/';
         }
         }
 
 
         defined('API_REQUEST_LOG_TYPE') or define('API_REQUEST_LOG_TYPE', $this->logType);
         defined('API_REQUEST_LOG_TYPE') or define('API_REQUEST_LOG_TYPE', $this->logType);
@@ -427,7 +428,7 @@ class Api
         if ($this->logType === 1){
         if ($this->logType === 1){
             //日志统一写入
             //日志统一写入
             register_shutdown_function([new LogUtil, 'close']);
             register_shutdown_function([new LogUtil, 'close']);
-            LogUtil::getInstance('Api/'); //设置日志存入通道
+            LogUtil::getInstance($path); //设置日志存入通道
 
 
             LogUtil::info('uid', 'Api-Middleware-Log', 'request_log', $this->auth->id);
             LogUtil::info('uid', 'Api-Middleware-Log', 'request_log', $this->auth->id);
             LogUtil::info('api', 'Api-Middleware-Log', 'request_log', $modulename . '/' . $controllername . '/' . $actionname);
             LogUtil::info('api', 'Api-Middleware-Log', 'request_log', $modulename . '/' . $controllername . '/' . $actionname);