Fonction PHP openlog()
Exemple
Ouvrir et fermer la connexion de l'enregistreur système :
<?php
function _log($text) {
openlog("phperrors", LOG_PID | LOG_PERROR);
syslog(LOG_ERR, $text);
closelog();
....
....
}
?>
Définition et utilisation
La fonction openlog() ouvre la connexion de l'enregistreur système.
Syntaxe
openlog(ident, option, facility)
Valeurs des paramètres
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:
|
Détails techniques
Valeur de retour : | VRAI en cas de succès, FAUX en cas d'échec |
---|---|
Version PHP : | 4.0+ |
❮ Référence réseau PHP