Функция PHP openlog()
Пример
Открыть и закрыть соединение системного регистратора:
<?php
function _log($text) {
openlog("phperrors", LOG_PID | LOG_PERROR);
syslog(LOG_ERR, $text);
closelog();
....
....
}
?>
Определение и использование
Функция openlog() открывает соединение с системным регистратором.
Синтаксис
openlog(ident, option, facility)
Значения параметров
Parameter | Description |
---|---|
ident | Required. Specifies a string ident that is added to each message |
option | Required. Specifies what logging options will be used when generating a
log message. Can be one or more of the following options (separated with |):
|
facility | Required. Specifies what type of program is logging the message:
|
Технические детали
Возвращаемое значение: | ИСТИНА в случае успеха, ЛОЖЬ в случае неудачи |
---|---|
Версия PHP: | 4.0+ |
❮ Справочник по сети PHP