Gestion d'erreur: Difference between revisions

Jump to navigation Jump to search
m
mNo edit summary
Line 23: Line 23:


{{ToTranslate}}
{{ToTranslate}}
The '''facility''' option allows you to use pre-set facilities to log your errors. Facilities are a system-level feature to tell your syslog operator where this error comes from, to judge priority and all that. You can find more about this inside the PHP documentation for the ''openlog()'' function which is used inside the ''dol_syslog()'' function: http://www.php.ne/openlog
La notion de '''facility''' de syslog est une notion de configuration pré-définie pour loguer les messages. C'est une fonctionnalité système pour dire à l'opérateur système d'ou vient une erreur (ici Dolibarr) et indiquer sa priorité. Vous trouverez plus d'informations dans la documentation PHP pour la fonction ''openlog()'' function qui est utilisé dans la fonction ''dol_syslog()'': http://www.php.ne/openlog
Really, you should leave it to '''LOG_USER''' unless you know exactly what you're doing.
En général, il vous faut laisser cette valeur à '''LOG_USER''', sauf si vous savez ce que vous faites.


The next option, '''file''', allows you to choose a file in which you will store the logs. The path you will indicate there should be relative to the system root (/). If you live it as it is (default option dolibarr.log), it will likely be opened in several directories, depending on the directory you're executing the script from. Of course, to do that, your web server must have write permissions on the directory you are using.
L'option suivante, '''fichier''', permet de choisir dans quel fichier vous allez sauver les logs. Le chemin indiqué doit etre relatif à la racine (/). Si vous le laisser tel quel (option par défaut DOL_DOCUMENT_ROOT/dolibarr.log), il sera crée dans le répertoire documents de Dolibarr. Bien sure, pour cela, votre serveur web doit avoir les droits en écritures sur ce répertoire.


Generally, the '''file''' facility will work more easily because it doesn't depend on your server configuration (or only for the directory that needs to be writeable).
En général, la facility '''fichier''' fonctionnera plus souvent car elle ne dépend pas de la configuration système de votre serveur ni d'un éventuel démon syslog requis (le seul problème qui peut arriver est que le répertoire n'est pas les droits en écriture pour le seveur web).


Finally, the level of reporting is how many types of errors you want to report. LOG_DEBUG(7) is the strongest option, reporting pretty much everything that calls a dol_syslog() function. LOG_EMERG(0) is the opposite, letting you see only the errors that would really block your system.
Finally, the level of reporting is how many types of errors you want to report. LOG_DEBUG(7) is the strongest option, reporting pretty much everything that calls a dol_syslog() function. LOG_EMERG(0) is the opposite, letting you see only the errors that would really block your system.

Navigation menu