Individual callstacks are removed from the logger

This commit is contained in:
Michael 2023-10-18 19:55:15 +00:00
parent d05fbe6e45
commit e4a37f344e
36 changed files with 66 additions and 86 deletions

View file

@ -23,7 +23,6 @@ namespace Friendica\Util;
use Friendica\Core\Hook;
use Friendica\Core\Logger;
use Friendica\Core\System;
use Friendica\DI;
use phpseclib3\Crypt\PublicKeyLoader;
@ -42,7 +41,7 @@ class Crypto
public static function rsaSign($data, $key, $alg = 'sha256')
{
if (empty($key)) {
Logger::warning('Empty key parameter', ['callstack' => System::callstack()]);
Logger::warning('Empty key parameter');
}
openssl_sign($data, $sig, $key, (($alg == 'sha1') ? OPENSSL_ALGO_SHA1 : $alg));
return $sig;
@ -58,7 +57,7 @@ class Crypto
public static function rsaVerify($data, $sig, $key, $alg = 'sha256')
{
if (empty($key)) {
Logger::warning('Empty key parameter', ['callstack' => System::callstack()]);
Logger::warning('Empty key parameter');
}
return openssl_verify($data, $sig, $key, (($alg == 'sha1') ? OPENSSL_ALGO_SHA1 : $alg));
}

View file

@ -208,7 +208,7 @@ class JsonLD
Logger::notice('compacting error', ['msg' => $e->getMessage(), 'previous' => $e->getPrevious(), 'line' => $e->getLine()]);
if ($logfailed && DI::config()->get('debug', 'ap_log_failure')) {
$tempfile = tempnam(System::getTempPath(), 'failed-jsonld');
file_put_contents($tempfile, json_encode(['json' => $orig_json, 'callstack' => System::callstack(20), 'msg' => $e->getMessage(), 'previous' => $e->getPrevious()], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
file_put_contents($tempfile, json_encode(['json' => $orig_json, 'msg' => $e->getMessage(), 'previous' => $e->getPrevious()], JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT));
Logger::notice('Failed message stored', ['file' => $tempfile]);
}
}

View file

@ -116,7 +116,7 @@ class Proxy
$size = ':' . $size;
}
Logger::info('Created proxy link', ['url' => $url, 'callstack' => System::callstack(20)]);
Logger::info('Created proxy link', ['url' => $url]);
// Too long files aren't supported by Apache
if (strlen($proxypath) > 250) {

View file

@ -23,7 +23,6 @@ namespace Friendica\Util;
use Friendica\Content\ContactSelector;
use Friendica\Core\Logger;
use Friendica\Core\System;
use ParagonIE\ConstantTime\Base64;
/**
@ -511,7 +510,7 @@ class Strings
);
if (is_null($return)) {
Logger::notice('Received null value from preg_replace_callback', ['text' => $text, 'regex' => $regex, 'blocks' => $blocks, 'executionId' => $executionId, 'callstack' => System::callstack(10)]);
Logger::notice('Received null value from preg_replace_callback', ['text' => $text, 'regex' => $regex, 'blocks' => $blocks, 'executionId' => $executionId]);
}
$text = $callback($return ?? $text) ?? '';

View file

@ -26,7 +26,6 @@ use DOMElement;
use DOMNode;
use DOMXPath;
use Friendica\Core\Logger;
use Friendica\Core\System;
use SimpleXMLElement;
/**
@ -451,7 +450,7 @@ class XML
$x = @simplexml_load_string($s);
if (!$x) {
if (!$suppress_log) {
Logger::error('Error(s) while parsing XML string.', ['callstack' => System::callstack()]);
Logger::error('Error(s) while parsing XML string.');
foreach (libxml_get_errors() as $err) {
Logger::info('libxml error', ['code' => $err->code, 'position' => $err->line . ':' . $err->column, 'message' => $err->message]);
}