class SysLogTest

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

Redirects logging messages to error_log.

Hierarchy

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

Title Sort descending Modifiers Object type Summary Overriden Title
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 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

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