You are here

DrupalLoggerAppender.php in Facebook Instant Articles 7

Same filename and directory in other branches
  1. 7.2 src/DrupalLoggerAppender.php

File

src/DrupalLoggerAppender.php
View source
<?php

/**
 * @file
 * Contains \Drupal\fb_instant_articles\DrupalLoggerAppender.
 */
namespace Drupal\fb_instant_articles;


/**
 * Adds Drupal logging functionality to existing SDK logging.
 *
 * Class DrupalLoggerAppender
 * @package Drupal\fb_instant_articles
 *
 * @see fb_instant_articles_display_init()
 */
class DrupalLoggerAppender extends \LoggerAppender {

  /**
   * {@inheritdoc}
   *
   * Additionally sends logging event to Drupal watchdog.
   */
  public function append(\LoggerLoggingEvent $event) {
    watchdog($event
      ->getLoggerName(), $event
      ->getRenderedMessage(), null, $event
      ->getLevel()
      ->getSyslogEquivalent());
  }

}

Classes

Namesort descending Description
DrupalLoggerAppender Adds Drupal logging functionality to existing SDK logging.