view core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php @ 9:1fc0ff908d1f

Add another data file
author Chris Cannam
date Mon, 05 Feb 2018 12:34:32 +0000
parents 4c8ae668cc8c
children
line wrap: on
line source
<?php

namespace Drupal\syslog_test\Logger;

use Drupal\syslog\Logger\SysLog;
use Psr\Log\LoggerInterface;

/**
 * Redirects logging messages to error_log.
 */
class SysLogTest extends SysLog implements LoggerInterface {

  /**
   * {@inheritdoc}
   */
  protected function syslogWrapper($level, $entry) {
    $log_path = \Drupal::service('file_system')->realpath('public://syslog.log');
    error_log($entry . PHP_EOL, 3, $log_path);
  }

}