mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-11 00:14:50 +03:00
Resolve #552
This commit is contained in:
parent
258afdd26e
commit
187dfcd126
4 changed files with 26 additions and 15 deletions
|
|
@ -164,6 +164,18 @@ class Actions
|
|||
$this->oLogger->AddForbiddenType(\MailSo\Log\Enumerations\Type::TIME);
|
||||
}
|
||||
|
||||
$level = \max(3, \RainLoop\Api::Config()->Get('logs', 'level', \LOG_WARNING)) - 3;
|
||||
$mailso = [
|
||||
\MailSo\Log\Enumerations\Type::ERROR,
|
||||
\MailSo\Log\Enumerations\Type::WARNING,
|
||||
\MailSo\Log\Enumerations\Type::NOTICE,
|
||||
\MailSo\Log\Enumerations\Type::INFO,
|
||||
\MailSo\Log\Enumerations\Type::DEBUG
|
||||
];
|
||||
while (4 > $level++) {
|
||||
$this->oLogger->AddForbiddenType($mailso[$level]);
|
||||
}
|
||||
|
||||
$this->oLogger->WriteEmptyLine();
|
||||
|
||||
$oHttp = $this->Http();
|
||||
|
|
|
|||
|
|
@ -30,13 +30,17 @@ abstract class Api
|
|||
public static function Config() : Config\Application
|
||||
{
|
||||
static $oConfig = null;
|
||||
if (!$oConfig)
|
||||
{
|
||||
if (!$oConfig) {
|
||||
$oConfig = new Config\Application();
|
||||
if (!$oConfig->Load()) {
|
||||
usleep(10000);
|
||||
\usleep(10000);
|
||||
$oConfig->Load();
|
||||
}
|
||||
if ($oConfig->Get('debug', 'enable', false)) {
|
||||
\error_reporting(E_ALL);
|
||||
\ini_set('display_errors', 1);
|
||||
\ini_set('log_errors', 1);
|
||||
}
|
||||
}
|
||||
return $oConfig;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,13 +22,6 @@ abstract class Service
|
|||
{
|
||||
$oConfig = Api::Config();
|
||||
|
||||
if ($oConfig->Get('debug', 'enable', false))
|
||||
{
|
||||
\error_reporting(E_ALL);
|
||||
\ini_set('display_errors', 1);
|
||||
\ini_set('log_errors', 1);
|
||||
}
|
||||
|
||||
$sServer = \trim($oConfig->Get('security', 'custom_server_signature', ''));
|
||||
if (\strlen($sServer))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -66,11 +66,13 @@ abstract class Log
|
|||
\closelog();
|
||||
}
|
||||
*/
|
||||
}
|
||||
if (($level < \LOG_WARNING && \error_reporting() & \E_ERROR)
|
||||
|| ($level == \LOG_WARNING && \error_reporting() & \E_WARNING)
|
||||
|| ($level > \LOG_WARNING && \error_reporting() & \E_NOTICE)) {
|
||||
\error_log($prefix . ' ' . static::$levels[$level] . ': ' . $msg);
|
||||
if (\filter_var(\ini_get('log_errors'), FILTER_VALIDATE_BOOLEAN)
|
||||
&& (($level < \LOG_WARNING && \error_reporting() & \E_ERROR)
|
||||
|| ($level == \LOG_WARNING && \error_reporting() & \E_WARNING)
|
||||
|| ($level > \LOG_WARNING && \error_reporting() & \E_NOTICE)
|
||||
)) {
|
||||
\error_log($prefix . ' ' . static::$levels[$level] . ': ' . $msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue