Переглянути джерело

换个位置

Signed-off-by: endoffight <endoffight@gmail.com>
endoffight 6 роки тому
батько
коміт
cae19c172b
1 змінених файлів з 7 додано та 5 видалено
  1. 7 5
      core/framework/libraries/log.php

+ 7 - 5
core/framework/libraries/log.php

@@ -116,17 +116,19 @@ class Log
         $pid = posix_getpid();
 
         $log_file = BASE_DATA_PATH . '/log/' . date('Ymd', time()) . '.log';
+
+        if(!file_exists($log_file)){
+            touch($log_file);
+            chmod($log_file,777);
+            //chown($log_file,'apache');
+        }
+
         if(self::$cur_file_name != $log_file)
         {
             if(self::$cur_file != null) {
                 fclose(self::$cur_file);
             }
             self::$cur_file_name = $log_file;
-            if(!file_exists($log_file)){
-                touch($log_file);
-                chmod($log_file,777);
-                //chown($log_file,'apache');
-            }
             self::$cur_file = fopen($log_file,'a+');
         }