days = intval(SiteSetting::get('website_log')['day']) ?: 7; } catch (\Exception $e) { } $this->log = new \Illuminate\Log\Logger(new Logger(config('app.env'))); $this->log->getLogger()->pushHandler( $handler = new RotatingFileHandler(storage_path() . '/' . $this->logDir, $this->days) ); $handler->setFormatter(new LineFormatter(null, null, true, true)); } abstract public function add($message, array $content = []); public function getLogger() { return $this->log; } }