mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03:00
Improved logging
This commit is contained in:
parent
7fec4e849b
commit
26d3509e28
3 changed files with 8 additions and 4 deletions
|
|
@ -227,6 +227,7 @@ class Utils
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
\SnappyMail\Log::warning("open_basedir restriction in effect. {$name} is not within the allowed path(s): " . \ini_get('open_basedir'));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -49,8 +49,11 @@ abstract class Log
|
||||||
|
|
||||||
protected static function log(int $level, string $prefix, string $msg)
|
protected static function log(int $level, string $prefix, string $msg)
|
||||||
{
|
{
|
||||||
|
static $log_level;
|
||||||
// Default to level 4, 0 = LOG_EMERG, 7 = LOG_DEBUG
|
// Default to level 4, 0 = LOG_EMERG, 7 = LOG_DEBUG
|
||||||
$log_level = \RainLoop\Api::Config()->Get('logs', 'level', \LOG_WARNING);
|
if (!$log_level) {
|
||||||
|
$log_level = \max(3, \RainLoop\Api::Config()->Get('logs', 'level', \LOG_WARNING));
|
||||||
|
}
|
||||||
if ($level <= $log_level) {
|
if ($level <= $log_level) {
|
||||||
\RainLoop\Api::Logger()->Write(
|
\RainLoop\Api::Logger()->Write(
|
||||||
$msg,
|
$msg,
|
||||||
|
|
|
||||||
|
|
@ -370,10 +370,10 @@ class GnuPG
|
||||||
: $this->GPG->verify($signed_text, $signature, $plaintext);
|
: $this->GPG->verify($signed_text, $signature, $plaintext);
|
||||||
if (!$result) {
|
if (!$result) {
|
||||||
if ($this->GnuPG) {
|
if ($this->GnuPG) {
|
||||||
\error_log('gnupg_verify() failed: ' . $this->GnuPG->geterror() . "\n\n{$signed_text}\n\n{$signature}" );
|
\SnappyMail\Log::notice('gnupg_verify() failed: ' . $this->GnuPG->geterror());
|
||||||
\error_log(\print_r($this->GnuPG->geterrorinfo(),1));
|
\SnappyMail\Log::info(\print_r($this->GnuPG->geterrorinfo(),1));
|
||||||
} else {
|
} else {
|
||||||
\error_log('GPG->verify() failed');
|
\SnappyMail\Log::notice('GPG->verify() failed');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $result;
|
return $result;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue