Example
Open and close connection of system logger:
html
<?php
function _log($text) {
openlog("phperrors", LOG_PID | LOG_PERROR);
syslog(LOG_ERR, $text);
closelog();
....
....
}
?>
Definition and Usage
The syslog() function generates a system log message.
Syntax
text
syslog(priority, message)
Parameter Values
| Parameter | Description |
|---|---|
| priority | Required. Specifies ... Can be one of the following options: LOG_EMERG LOG_ALERT LOG_CRIT LOG_ERR LOG_WARNING LOG_NOTICE LOG_INFO LOG_DEBUG |
| message | Required. Specifies the message to send |
Technical Details
| Return Value: | TRUE on success, FALSE on failure |
|---|---|
| PHP Version: | 4.0+ |