LOG_USER ); /** * Log level to syslog severity map * * @var array */ public static $severityMap = array( Logger::ERROR => LOG_ERR, Logger::WARNING => LOG_WARNING, Logger::INFO => LOG_INFO, Logger::DEBUG => LOG_DEBUG ); /** * Create a new syslog log writer * * @param ConfigObject $config */ public function __construct(ConfigObject $config) { $this->ident = $config->get('application', 'icingaweb2'); $this->facility = static::$facilities['user']; } /** * Log a message * * @param int $level The logging level * @param string $message The log message */ public function log($level, $message) { openlog($this->ident, LOG_PID, $this->facility); syslog(static::$severityMap[$level], str_replace("\n", ' ', $message)); } }