$this->introspection->addClasses(array(self::class));
}
+ /**
+ * 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);
+ }
+
/**
* Maps the LogLevel (@see LogLevel ) to a SysLog priority (@see http://php.net/manual/en/function.syslog.php#refsect1-function.syslog-parameters )
*
return $this->logLevels[$level];
}
+ /**
+ * Closes the Syslog
+ */
+ public function close()
+ {
+ closelog();
+ }
+
/**
* Writes a message to the syslog
* @see http://php.net/manual/en/function.syslog.php#refsect1-function.syslog-parameters
syslog($priority, $message);
}
- /**
- * Closes the Syslog
- */
- public function close()
- {
- closelog();
- }
-
/**
* Formats a log record for the syslog output
*
return $logMessage;
}
-
- /**
- * 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($level, $message, $context);
- $this->write($level, $formattedLog);
- }
}