示例#1
0
 /**
  * @param string $message
  * @param string $type
  */
 public static function write($message, $type = 'logs')
 {
     if (\null === static::$logger) {
         if (!config('log.enabled') || !($handler = config('log.path'))) {
             return;
         }
         file_put_contents(rtrim($handler, '/') . '/' . $type . '.txt', date('d M Y (h:m:i)') . ' - ' . $message . "\n", FILE_APPEND | LOCK_EX);
         return;
     }
     static::$logger->write($message, $type);
 }