Changes

m
Import interlang links (links to translated versions of this page in other languages) from Multi Language Manager table.
Line 1: Line 1:  +
<!-- BEGIN origin interlang links -->
 +
<!-- You can edit this section but do NOT remove these comments
 +
    Links below will be automatically replicated on translated pages by PolyglotBot -->
 +
[[es:Módulo_Syslog_(desarrollador)]]
 +
[[fr:Module_Syslog_(développeur)]]
 +
<!-- END interlang links -->
 +
 
[[Category:Syslog]]
 
[[Category:Syslog]]
[[Category:List of Modules]]
+
[[Category:List of Modules (developer)‎]]
 
{{TemplateDocDevEn}}
 
{{TemplateDocDevEn}}
 +
{{TemplateModEN Developer}}
 
{{BasculeDevUser|
 
{{BasculeDevUser|
 
nom=Users|
 
nom=Users|
Line 8: Line 16:  
userdoc=None}}
 
userdoc=None}}
    +
= 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">
 +
dol_syslog($message, $level = LOG_INFO)
 +
</source>
 +
 +
''This function is defined into file dolibarr/htdocs/lib/functions.lib.php''
 +
 +
== Parameters ==
 +
 +
* '''$message''' : string with message to write into log file
 +
* '''$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
    +
= See also =
    +
Doxygen Documentation : [http://www.dolibarr.fr/doxygen/d9/d69/functions_8lib_8php.html#a9862cc723ca3a2d05ef5723946cc9250]
   −
= Feature =
+
{{ToComplete}}
1,979

edits