What is php openlog functions?

  • Open and close connection of system logger

php openlog() function syntax:

openlog(ident, option, facility)

ex:

function _log($text) {

openlog("phperrors", LOG_PID | LOG_PERROR);

syslog(LOG_ERR, $text);

closelog();

....

....

}

?>

  • The openlog() function opens the connection of system logger

Parameters:

Ident(phperrors):

  • Required. Specifies a string ident that is added to each message

Option(LOG_PID):

  • Required. Specifies what logging options will be used when generating a log message.

facility(LOG_PERROR):

  • Required. Specifies what type of program is logging the message
  • LOG_AUTH
  • LOG_MAIL


Sign In or Register to comment.