31,040
edits
mNo edit summary |
mNo edit summary |
||
| Line 12: | Line 12: | ||
= Fonction du module = | = Fonction du module = | ||
This module allows to enable technical logging into Dolibarr. Logging is used to save messages into log files : | |||
* | * Into a file | ||
** | ** File will be by default '''DOL_DATA_ROOT/dolibarr.log''' (for example '''C:/dolibarr/documents/dolibarr.log'''). | ||
** | ** You can change file name on the setup page of module. | ||
* | * Into systems logs (using syslog) | ||
See module setup to choose. | |||
= | = PHP functions = | ||
== | == Definition == | ||
To use loggin in your PHP coding, you must use the following function : | |||
<source lang="php"> | <source lang="php"> | ||
| Line 31: | Line 31: | ||
</source> | </source> | ||
'' | ''This function is defined into file dolibarr/htdocs/lib/functions.lib.php'' | ||
== | == Parameters == | ||
* '''$message''' : | * '''$message''' : string with message to write into log file | ||
* '''$level''' : | * '''$level''' : constant that define level of message. It can have following values: | ||
** | ** On Windows server: LOG_ERR=4, LOG_WARNING=5, LOG_NOTICE=LOG_INFO=LOG_DEBUG=6 | ||
** | ** On Unix/Linux server : LOG_ERR=3, LOG_WARNING=4, LOG_INFO=6, LOG_DEBUG=7 | ||
** | ** You can then set the level of messages you want to write, with the module setup page. | ||
= | = Notes = | ||
''" | ''"Syslog functions are bugged with Windows et generates memory protection fault.'' | ||
'' | ''To solve this, use the file logging instead of syslog logging (see module setup page). | ||
If SYSLOG_FILE_NO_ERROR is defined in your PHP code, no message will be output on screen when there is an error when writing the log message."'' | |||
Source: documentation Doxygen | Source: documentation Doxygen | ||
= | = See also = | ||
Documentation | Doxygen Documentation : [http://www.dolibarr.fr/doxygen/d9/d69/functions_8lib_8php.html#a9862cc723ca3a2d05ef5723946cc9250] | ||
{{ToComplete}} | {{ToComplete}} | ||