You are here

class SysLogTest in Drupal 8

Same name in this branch
  1. 8 core/modules/syslog/tests/src/Functional/SyslogTest.php \Drupal\Tests\syslog\Functional\SyslogTest
  2. 8 core/modules/syslog/tests/src/Kernel/SyslogTest.php \Drupal\Tests\syslog\Kernel\SyslogTest
  3. 8 core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php \Drupal\syslog_test\Logger\SysLogTest
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
  2. 10 core/modules/syslog/tests/modules/syslog_test/src/Logger/SysLogTest.php \Drupal\syslog_test\Logger\SysLogTest

Redirects logging messages to error_log.

Hierarchy

  • class \Drupal\syslog\Logger\SysLog implements \Psr\Log\LoggerInterface uses RfcLoggerTrait
    • class \Drupal\syslog_test\Logger\SysLogTest implements \Psr\Log\LoggerInterface

Expanded class hierarchy of SysLogTest

1 string reference to 'SysLogTest'
syslog_test.services.yml in core/modules/syslog/tests/modules/syslog_test/syslog_test.services.yml
core/modules/syslog/tests/modules/syslog_test/syslog_test.services.yml
1 service uses SysLogTest
logger.syslog_test in core/modules/syslog/tests/modules/syslog_test/syslog_test.services.yml
Drupal\syslog_test\Logger\SysLogTest

File

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

Namespace

Drupal\syslog_test\Logger
View source
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);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
RfcLoggerTrait::alert public function
RfcLoggerTrait::critical public function
RfcLoggerTrait::debug public function
RfcLoggerTrait::emergency public function
RfcLoggerTrait::error public function
RfcLoggerTrait::info public function
RfcLoggerTrait::notice public function
RfcLoggerTrait::warning public function
SysLog::$config protected property A configuration object containing syslog settings.
SysLog::$connectionOpened protected property Stores whether there is a system logger connection opened or not.
SysLog::$parser protected property The message's placeholders parser.
SysLog::log public function Logs with an arbitrary level. Overrides RfcLoggerTrait::log
SysLog::openConnection protected function Opens a connection to the system logger.
SysLog::__construct public function Constructs a SysLog object.
SysLogTest::syslogWrapper protected function A syslog wrapper to make syslog functionality testable. Overrides SysLog::syslogWrapper