function SysLog::openConnection

Same name and namespace in other branches
  1. 11.x core/modules/syslog/src/Logger/SysLog.php \Drupal\syslog\Logger\SysLog::openConnection()
  2. 10 core/modules/syslog/src/Logger/SysLog.php \Drupal\syslog\Logger\SysLog::openConnection()
  3. 8.9.x core/modules/syslog/src/Logger/SysLog.php \Drupal\syslog\Logger\SysLog::openConnection()

Opens a connection to the system logger.

File

core/modules/syslog/src/Logger/SysLog.php, line 53

Class

SysLog
Redirects logging messages to syslog.

Namespace

Drupal\syslog\Logger

Code

protected function openConnection() {
  if (!$this->connectionOpened) {
    $facility = $this->config
      ->get('facility');
    $this->connectionOpened = openlog($this->config
      ->get('identity'), LOG_NDELAY, $facility);
  }
}

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