PHP -openlog()- Funktion
Beispiel
Verbindung des Systemloggers öffnen und schließen:
<?php
function _log($text) {
openlog("phperrors", LOG_PID | LOG_PERROR);
syslog(LOG_ERR, $text);
closelog();
....
....
}
?>
Definition und Verwendung
Die Funktion openlog() öffnet die Verbindung zum Systemlogger.
Syntax
openlog(ident, option, facility)
Parameterwerte
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:
|
Technische Details
Rückgabewert: | TRUE bei Erfolg, FALSE bei Misserfolg |
---|---|
PHP-Version: | 4.0+ |
❮ PHP-Netzwerkreferenz