You are here

interface LogsHttpLoggerInterface in Logs HTTP 8

Describes a Logs Http Logger instance.

Hierarchy

Expanded class hierarchy of LogsHttpLoggerInterface

All classes that implement LogsHttpLoggerInterface

File

src/Logger/LogsHttpLoggerInterface.php, line 10

Namespace

Drupal\logs_http\Logger
View source
interface LogsHttpLoggerInterface extends LoggerInterface {

  /**
   * Clear the events.
   */
  public function reset();

  /**
   * Register an event in the cache.
   *
   * Modules extending this service, in need for different data to be added
   * to the event will likely override this method in the following way:
   *
   * @code
   * public function registerEvent($level, string $message, array $context = []) {
   *   $event = parent::registerEvent($level, $message, $context);
   *
   *   // Update our custom value(s).
   *   $event['foo'] = 'bar';
   *
   *   return $event;
   * }
   * @endcode
   *
   * @param int $level
   *   The severity level.
   * @param string $message
   *   The message that contains the placeholders.
   * @param array $context
   *   The context as passed from the main Logger.
   *
   * @return array
   *   The event that was created, before it's added to the static cache.
   */
  public function registerEvent($level, string $message, array $context = []);

  /**
   * A getter for the current events.
   *
   * @return array
   *   List of events.
   */
  public function getEvents();

  /**
   * Check weather we should use Logs http module or not.
   *
   * @return bool
   *   TRUE if enabled.
   */
  public function isEnabled();

  /**
   * A getter for the url of the endpoint we should send the data to.
   *
   * @return string
   *   The URL.
   */
  public function getUrl();

  /**
   * A getter for the HTTP headers for the logging request.
   *
   * It could be used typically for authentication.
   *
   * @return array
   *   HTTP headers for the logging requests.
   */
  public function getHttpHeaders();

}

Members

Namesort descending Modifiers Type Description Overrides
LogsHttpLoggerInterface::getEvents public function A getter for the current events. 1
LogsHttpLoggerInterface::getHttpHeaders public function A getter for the HTTP headers for the logging request. 1
LogsHttpLoggerInterface::getUrl public function A getter for the url of the endpoint we should send the data to. 1
LogsHttpLoggerInterface::isEnabled public function Check weather we should use Logs http module or not. 1
LogsHttpLoggerInterface::registerEvent public function Register an event in the cache. 1
LogsHttpLoggerInterface::reset public function Clear the events. 1