[Legacy] Adjust log level on install

Rename to feedback
This commit is contained in:
Clemente Raposo 2025-01-24 10:32:47 +00:00 committed by Jack Anderson
parent 4adc02068c
commit 4176be0492
4 changed files with 17 additions and 7 deletions

View file

@ -114,6 +114,8 @@ class AppInstallService
require_once 'data/SugarBean.php';
require_once 'include/entryPoint.php';
$this->switchLogger();
if (!empty($sugar_config['installer_locked']) && (isset($sugar_config['installed']) && $sugar_config['installed'] === true)) {
return $this->buildResult(false, ['Installer has been disabled']);
}
@ -134,8 +136,6 @@ class AppInstallService
$locale = new Localization();
$this->switchLogger();
$setup_sugar_version = $suitecrm_version;
$install_script = true;

View file

@ -33,6 +33,10 @@ require_once 'include/SugarLogger/SugarLogger.php';
class InstallLogger extends SugarLogger
{
protected $log_dir = '../../logs';
protected $logfile = 'install';
protected function init(): void
{
$config = SugarConfig::getInstance();
@ -43,8 +47,8 @@ class InstallLogger extends SugarLogger
$this->logSize = '100MB';
$this->logfile = 'install';
$this->ext = '.log';
$log_dir = __DIR__ . '/../../../../../../logs';
$this->log_dir = $log_dir . (empty($log_dir) ? '' : '/');
$this->log_dir = $this->log_dir . (empty($this->log_dir)?'':'/');
unset($config);
$this->_doInitialization();
InstallLoggerManager::setLogger('default', 'InstallLogger');

View file

@ -38,7 +38,7 @@ class InstallLoggerManager extends LoggerManager
* This is the current log level
* @var string
*/
private static $_level = 'info';
private static $_level = 'fatal';
/**
* This is the instance of the LoggerManager
@ -59,6 +59,7 @@ class InstallLoggerManager extends LoggerManager
'deprecated' => 40,
'error' => 25,
'fatal' => 10,
'feedback' => 7,
'security' => 5,
'off' => 0,
];
@ -66,7 +67,7 @@ class InstallLoggerManager extends LoggerManager
//only let the getLogger instantiate this object
private function __construct()
{
$this->setLevel('info');
$this->setLevel('fatal');
if (empty(self::$_loggers)) {
$this->_findAvailableLoggers();
@ -107,5 +108,10 @@ class InstallLoggerManager extends LoggerManager
}
}
}
self::$_loggers['SugarLogger'] = new InstallLogger();
self::$_loggers['InstallLogger'] = new InstallLogger();
}
}

View file

@ -770,7 +770,7 @@ function handleLog4Php()
function installLog($entry)
{
if (!empty($GLOBALS['install_log'])) {
$GLOBALS['install_log']->info($entry);
$GLOBALS['install_log']->feedback($entry);
return;
}