mirror of
https://github.com/the-djmaze/snappymail.git
synced 2024-11-10 09:02:45 +08: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;
|
||||
}
|
||||
}
|
||||
\SnappyMail\Log::warning("open_basedir restriction in effect. {$name} is not within the allowed path(s): " . \ini_get('open_basedir'));
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -49,8 +49,11 @@ abstract class Log
|
|||
|
||||
protected static function log(int $level, string $prefix, string $msg)
|
||||
{
|
||||
static $log_level;
|
||||
// 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) {
|
||||
\RainLoop\Api::Logger()->Write(
|
||||
$msg,
|
||||
|
|
|
@ -370,10 +370,10 @@ class GnuPG
|
|||
: $this->GPG->verify($signed_text, $signature, $plaintext);
|
||||
if (!$result) {
|
||||
if ($this->GnuPG) {
|
||||
\error_log('gnupg_verify() failed: ' . $this->GnuPG->geterror() . "\n\n{$signed_text}\n\n{$signature}" );
|
||||
\error_log(\print_r($this->GnuPG->geterrorinfo(),1));
|
||||
\SnappyMail\Log::notice('gnupg_verify() failed: ' . $this->GnuPG->geterror());
|
||||
\SnappyMail\Log::info(\print_r($this->GnuPG->geterrorinfo(),1));
|
||||
} else {
|
||||
\error_log('GPG->verify() failed');
|
||||
\SnappyMail\Log::notice('GPG->verify() failed');
|
||||
}
|
||||
}
|
||||
return $result;
|
||||
|
|
Loading…
Reference in a new issue