Browse Source

begin logs

develop
Robin Thoni 8 years ago
parent
commit
4782a892a3
2 changed files with 11 additions and 0 deletions
  1. 10
    0
      src/Utils/Business/LuLog.php
  2. 1
    0
      src/Utils/Controller/LuticateApplication.php

+ 10
- 0
src/Utils/Business/LuLog.php View File

4
 
4
 
5
 class LuLog {
5
 class LuLog {
6
 
6
 
7
+    /**
8
+     * @var $_logFilePath string
9
+     */
10
+    private static $_logFilePath;
11
+
12
+    public static function setLogFilePath($logFilePath) {
13
+        self::$_logFilePath = $logFilePath;
14
+    }
15
+
7
     public static function log($data)
16
     public static function log($data)
8
     {
17
     {
18
+        file_put_contents(self::$_logFilePath, $data, FILE_APPEND);
9
     }
19
     }
10
 }
20
 }

+ 1
- 0
src/Utils/Controller/LuticateApplication.php View File

39
         $this->_config = $configuration;
39
         $this->_config = $configuration;
40
         $this->_clients = new \SplObjectStorage;
40
         $this->_clients = new \SplObjectStorage;
41
         $this->_router = new LuRoute();
41
         $this->_router = new LuRoute();
42
+        LuLog::setLogFilePath($this->_config["logs"]);
42
         self::$_app = $this;
43
         self::$_app = $this;
43
     }
44
     }
44
 
45
 

Loading…
Cancel
Save