You are here

function _syslog_advanced_init_log in Advanced syslog 7

Opens the syslog.

This function makes sure that syslog will not be opened twice.

1 call to _syslog_advanced_init_log()
syslog_advanced_watchdog in ./syslog_advanced.module
Implements hook_watchdog().

File

./syslog_advanced.module, line 248
Redirects logging messages to syslog.

Code

function _syslog_advanced_init_log() {
  $log_init =& drupal_static('syslog_watchdog', FALSE);
  if (!$log_init) {
    $log_init = TRUE;
    $default_facility = defined('LOG_LOCAL0') ? LOG_LOCAL0 : LOG_USER;
    $identity = variable_get('syslog_advanced_identity', 'drupal');
    $facility = variable_get('syslog_advanced_facility', $default_facility);
    openlog($identity, LOG_NDELAY, $facility);
  }
}