diff --git a/htdocs/admin/syslog.php b/htdocs/admin/syslog.php index b0699f99aa5..941f1728c03 100644 --- a/htdocs/admin/syslog.php +++ b/htdocs/admin/syslog.php @@ -37,7 +37,7 @@ $action = GETPOST("action"); $syslogModules = array(); $activeModules = array(); -if (defined('SYSLOG_HANDLERS')) $activeModules = json_decode(SYSLOG_HANDLERS); +if (defined('SYSLOG_HANDLERS')) $activeModules = json_decode(constant('SYSLOG_HANDLERS')); $dir = dol_buildpath('/core/modules/syslog/'); diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 9cf96f14aeb..9d44addfe81 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -152,7 +152,7 @@ class Conf $value=$objp->value; if ($key) { - if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_FILE_ON and SYSLOG_FILE during install) + if (! defined("$key")) define("$key", $value); // In some cases, the constant might be already forced (Example: SYSLOG_HANDLERS during install) $this->global->$key=$value; if ($value && preg_match('/^MAIN_MODULE_/',$key)) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index f216bfb359b..04802d3d28f 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -473,8 +473,8 @@ function dol_strtoupper($utf8_string) /** * Write log message into outputs. Possible outputs can be: - * A file if SYSLOG_FILE_ON defined: file name is then defined by SYSLOG_FILE - * Syslog if SYSLOG_SYSLOG_ON defined: facility is then defined by SYSLOG_FACILITY + * SYSLOG_HANDLERS = ["mod_syslog_file"] file name is then defined by SYSLOG_FILE + * SYSLOG_HANDLERS = ["mod_syslog_syslog"] facility is then defined by SYSLOG_FACILITY * Warning, syslog functions are bugged on Windows, generating memory protection faults. To solve * this, use logging to files instead of syslog (see setup of module). * Note: If SYSLOG_FILE_NO_ERROR defined, we never output any error message when writing to log fails. diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 04d4ac6de93..4e913e7810b 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -303,7 +303,7 @@ function conf($dolibarr_main_document_root) // Force usage of log file for install and upgrades $conf->syslog->enabled=1; $conf->global->SYSLOG_LEVEL=constant('LOG_DEBUG'); - if (! defined('SYSLOG_FILE_ON')) define('SYSLOG_FILE_ON',1); + if (! defined('SYSLOG_HANDLERS')) define('SYSLOG_HANDLERS','["mod_syslog_file"]'); if (! defined('SYSLOG_FILE')) // To avoid warning on systems with constant already defined { if (@is_writable('/tmp')) define('SYSLOG_FILE','/tmp/dolibarr_install.log'); diff --git a/htdocs/install/mysql/data/llx_const.sql b/htdocs/install/mysql/data/llx_const.sql index 973152f119c..d9fdc2ba8da 100644 --- a/htdocs/install/mysql/data/llx_const.sql +++ b/htdocs/install/mysql/data/llx_const.sql @@ -35,7 +35,7 @@ insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_N insert into llx_const (name, value, type, note, visible, entity) values ('MAIN_FEATURES_LEVEL','0','chaine','Level of features to show (0=stable only, 1=stable+experimental, 2=stable+experimental+development',1,0); -- Hidden and common to all entities -insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE_ON','1','chaine','Log to file Directory where to write log file',0,0); +insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_HANDLERS','["mod_syslog_file"]','chaine','Which logger to use',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_FILE','DOL_DATA_ROOT/dolibarr.log','chaine','Directory where to write log file',0,0); insert into llx_const (name, value, type, note, visible, entity) values ('SYSLOG_LEVEL','7','chaine','Level of debug info to show',0,0);