You are here

protected function SysLogTest::syslogWrapper in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php \Drupal\syslog_test\Logger\SysLogTest::syslogWrapper()

A syslog wrapper to make syslog functionality testable.

Parameters

int $level: The syslog priority.

string $entry: The message to send to syslog function.

Overrides SysLog::syslogWrapper

File

core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php, line 16

Class

SysLogTest
Redirects logging messages to error_log.

Namespace

Drupal\syslog_test\Logger

Code

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