pushHandler(new RotatingFileHandler(storage_path($logPath), $maxFiles,$level)); // 对应日志级别记录日志 $log->log($level,$message,$content); } /** * Adds a log record at the DEBUG level. * This method allows for compatibility with common interfaces. * */ public function debug(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::DEBUG,$options); } /** * Adds a log record at the INFO level. * * This method allows for compatibility with common interfaces. * */ public function info(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::INFO,$options); } /** * Adds a log record at the NOTICE level. * * This method allows for compatibility with common interfaces. * */ public function notice(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::NOTICE, $options); } /** * Adds a log record at the WARNING level. * * This method allows for compatibility with common interfaces. * */ public function warning(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::WARNING, $options); } /** * Adds a log record at the ERROR level. * * This method allows for compatibility with common interfaces. * */ public function error(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::ERROR, $options); } /** * Adds a log record at the CRITICAL level. * * This method allows for compatibility with common interfaces. * */ public function critical(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::CRITICAL, $options); } /** * Adds a log record at the ALERT level. * * This method allows for compatibility with common interfaces. * */ public function alert(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::ALERT, $options); } /** * Adds a log record at the EMERGENCY level. * * This method allows for compatibility with common interfaces. * */ public function emergency(string $name,string $message,array $content=[],array $options=[]) { $this->log($name,$message,$content,Logger::EMERGENCY, $options); } }