+ /**
+ * Adds a new entry to the syslog
+ *
+ * @param int $level
+ * @param string $message
+ * @param array $context
+ *
+ * @throws InternalServerErrorException if the syslog isn't available
+ */
+ protected function addEntry($level, $message, $context = [])
+ {
+ $logLevel = $this->mapLevelToPriority($level);
+
+ if ($logLevel > $this->logLevel) {
+ return;
+ }
+
+ $formattedLog = $this->formatLog($logLevel, $message, $context);
+ $this->write($logLevel, $formattedLog);
+ }
+