SysLogTest.php

Same filename in this branch
  1. 9 core/modules/syslog/tests/src/Kernel/SyslogTest.php
  2. 9 core/modules/syslog/tests/src/Functional/SyslogTest.php
Same filename and directory in other branches
  1. 8.9.x core/modules/syslog/tests/src/Kernel/SyslogTest.php
  2. 8.9.x core/modules/syslog/tests/src/Functional/SyslogTest.php
  3. 8.9.x core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php
  4. 10 core/modules/syslog/tests/src/Kernel/SyslogTest.php
  5. 10 core/modules/syslog/tests/src/Functional/SyslogTest.php
  6. 10 core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php
  7. 11.x core/modules/syslog/tests/src/Kernel/SyslogTest.php
  8. 11.x core/modules/syslog/tests/src/Functional/SyslogTest.php
  9. 11.x core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php

Namespace

Drupal\syslog_test\Logger

File

core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php

View 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);
    }

}

Classes

Title Deprecated Summary
SysLogTest Redirects logging messages to error_log.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.