closelog in PHP

Syntax of closelog

int closelog()

Closes the file descriptor used to write to the system logger after an openlog() call. Returns true if the change was successful and false if not.

Example of closelog in PHP

<?php
function _log($text) {
openlog("phperrors", LOG_PID | LOG_PERROR);
syslog(LOG_ERR, $text);
closelog();
....
....
}
?>

Leave a Comment