Fix: init of new syslog handler system
This commit is contained in:
parent
49313fff3b
commit
285bcbecb7
@ -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/');
|
||||
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -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.
|
||||
|
||||
@ -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');
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user