@@ -16,8 +16,8 @@ discard block |
||
| 16 | 16 | |
| 17 | 17 | |
| 18 | 18 | if (!defined('LOG_DIR')) { |
| 19 | - GeneratorHelper::createDir(BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
| 20 | - define('LOG_DIR', BASE_DIR . DIRECTORY_SEPARATOR . 'logs'); |
|
| 19 | + GeneratorHelper::createDir(BASE_DIR.DIRECTORY_SEPARATOR.'logs'); |
|
| 20 | + define('LOG_DIR', BASE_DIR.DIRECTORY_SEPARATOR.'logs'); |
|
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | /** |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | $config = Config::getInstance(); |
| 56 | 56 | $args = func_get_args(); |
| 57 | 57 | list($logger, $debug, $path) = $this->setup($config, $args); |
| 58 | - $this->stream = fopen($path . DIRECTORY_SEPARATOR . date('Ymd') . '.log', 'a+'); |
|
| 58 | + $this->stream = fopen($path.DIRECTORY_SEPARATOR.date('Ymd').'.log', 'a+'); |
|
| 59 | 59 | $this->addPushLogger($logger, $debug, $config); |
| 60 | 60 | $this->logLevel = Config::getParam('log.level', 'NOTICE'); |
| 61 | 61 | } |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | private function createLoggerPath(Config $config) |
| 143 | 143 | { |
| 144 | 144 | $logger = $this->setLoggerName($config); |
| 145 | - $path = LOG_DIR . DIRECTORY_SEPARATOR . $logger . DIRECTORY_SEPARATOR . date('Y') . DIRECTORY_SEPARATOR . date('m'); |
|
| 145 | + $path = LOG_DIR.DIRECTORY_SEPARATOR.$logger.DIRECTORY_SEPARATOR.date('Y').DIRECTORY_SEPARATOR.date('m'); |
|
| 146 | 146 | GeneratorHelper::createDir($path); |
| 147 | 147 | |
| 148 | 148 | return $path; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | * @return bool |
| 164 | 164 | */ |
| 165 | 165 | private function checkLogLevel($level = \Monolog\Logger::NOTICE) { |
| 166 | - switch($this->logLevel) { |
|
| 166 | + switch ($this->logLevel) { |
|
| 167 | 167 | case 'DEBUG': $logPass = Monolog::DEBUG; break; |
| 168 | 168 | case 'INFO': $logPass = Monolog::INFO; break; |
| 169 | 169 | default: |
@@ -182,10 +182,10 @@ discard block |
||
| 182 | 182 | */ |
| 183 | 183 | public static function log($msg, $type = LOG_DEBUG, array $context = null) |
| 184 | 184 | { |
| 185 | - if(null === $context) { |
|
| 185 | + if (null === $context) { |
|
| 186 | 186 | $context = []; |
| 187 | 187 | } |
| 188 | - if(Config::getParam('profiling.enable') && 'DEBUG' === Config::getParam('log.level', 'NOTICE')) { |
|
| 188 | + if (Config::getParam('profiling.enable') && 'DEBUG' === Config::getParam('log.level', 'NOTICE')) { |
|
| 189 | 189 | Inspector::stats($msg); |
| 190 | 190 | } |
| 191 | 191 | switch ($type) { |
@@ -196,7 +196,7 @@ discard block |
||
| 196 | 196 | self::getInstance()->addLog($msg, \Monolog\Logger::WARNING, $context); |
| 197 | 197 | break; |
| 198 | 198 | case LOG_CRIT: |
| 199 | - if(Config::getParam('log.slack.hook')) { |
|
| 199 | + if (Config::getParam('log.slack.hook')) { |
|
| 200 | 200 | SlackHelper::getInstance()->trace($msg, '', '', $context); |
| 201 | 201 | } |
| 202 | 202 | self::getInstance()->addLog($msg, \Monolog\Logger::CRITICAL, $context); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | { |
| 240 | 240 | $context['uri'] = null !== $_SERVER && array_key_exists('REQUEST_URI', $_SERVER) ? $_SERVER['REQUEST_URI'] : 'Unknow'; |
| 241 | 241 | $context['method'] = null !== $_SERVER && array_key_exists('REQUEST_METHOD', $_SERVER) ? $_SERVER['REQUEST_METHOD'] : 'Unknow'; |
| 242 | - if(null !== $_SERVER && array_key_exists('HTTP_X_PSFS_UID', $_SERVER)) { |
|
| 242 | + if (null !== $_SERVER && array_key_exists('HTTP_X_PSFS_UID', $_SERVER)) { |
|
| 243 | 243 | $context['uid'] = $_SERVER['HTTP_X_PSFS_UID']; |
| 244 | 244 | } |
| 245 | 245 | return $context; |