/** * Write the message to the log facility. * * @param int $loglevel * @param string $data * @param string $logfile * * @access private * @return void */ private static function writeToLog($loglevel, $data, $logfile = null) { if (self::$syslogEnabled) { if (ZSyslog::send($loglevel, $data) === false) { error_log("Unable to send to syslog"); error_log($data); } } else { if (@file_put_contents($logfile, $data, FILE_APPEND) === false) { error_log(sprintf("Unable to write in %s", $logfile)); error_log($data); } } }