You are here

protected function SysLog::openConnection in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/syslog/src/Logger/SysLog.php \Drupal\syslog\Logger\SysLog::openConnection()

Opens a connection to the system logger.

1 call to SysLog::openConnection()
SysLog::log in core/modules/syslog/src/Logger/SysLog.php
Logs with an arbitrary level.

File

core/modules/syslog/src/Logger/SysLog.php, line 58
Contains \Drupal\syslog\Logger\SysLog.

Class

SysLog
Redirects logging messages to syslog.

Namespace

Drupal\syslog\Logger

Code

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