Error reporting: Difference between revisions

no edit summary
mNo edit summary
No edit summary
Line 4: Line 4:
= Functions =
= Functions =
Following function allows to log informations in Dolibarr log file
Following function allows to log informations in Dolibarr log file
dol_syslog($message, LOG_DEBUG|LOG_INFO|LOG_WARNING|LOG_ERR);
<source lang="php">dol_syslog($message, LOG_DEBUG|LOG_INFO|LOG_WARNING|LOG_ERR);</source>
The log level is related to setup defined in module Syslog (see lower).
The log level is related to setup defined in module Syslog (see lower).


Following function can be used to add error information on screen. Usage must be reserved in never reached code.
Following function can be used to add error information on screen. Usage must be reserved in never reached code.
dol_print_error($db,texte);
<source lang="php">dol_print_error($db,texte);</source>


= Module Syslog =  
= Module Syslog =  
Line 30: Line 30:
= Other rare system logs =
= Other rare system logs =
Note that you can have also find some technical PHP/Apache errors in apache log file (whatever is status/setup of this module). But this occurs only if there is a technical problem in your installation: On a typical Linux install, such logs will be available somewhere in '''/var/log/apache[2]/[dolibarr]-error.log'''. You can watch it ''live'' from the terminal by using:
Note that you can have also find some technical PHP/Apache errors in apache log file (whatever is status/setup of this module). But this occurs only if there is a technical problem in your installation: On a typical Linux install, such logs will be available somewhere in '''/var/log/apache[2]/[dolibarr]-error.log'''. You can watch it ''live'' from the terminal by using:
  tail -f /var/log/apache2/dolibarr-error.log
<source lang="bash">tail -f /var/log/apache2/dolibarr-error.log</source>