diff --git a/library/think/Log.php b/library/think/Log.php index 6aa62a5e..e9d2bb58 100644 --- a/library/think/Log.php +++ b/library/think/Log.php @@ -67,12 +67,12 @@ class Log */ public static function init($config = []) { - self::$config = $config; - unset($config['type']); - $type = isset($config['type']) ? $config['type'] : 'File'; $class = false !== strpos($type, '\\') ? $type : '\\think\\log\\driver\\' . ucwords($type); + self::$config = $config; + unset($config['type']); + if (class_exists($class)) { self::$driver = new $class($config); } else {