]> git.mxchange.org Git - friendica.git/commitdiff
Individual callstacks are removed from the logger
authorMichael <heluecht@pirati.ca>
Wed, 18 Oct 2023 19:55:15 +0000 (19:55 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 18 Oct 2023 19:55:15 +0000 (19:55 +0000)
36 files changed:
src/BaseModule.php
src/Content/Text/Markdown.php
src/Content/Widget/VCard.php
src/Core/Logger/Util/Introspection.php
src/Core/System.php
src/Core/Worker.php
src/Database/Database.php
src/Model/APContact.php
src/Model/Contact.php
src/Model/Contact/User.php
src/Model/GServer.php
src/Model/Item.php
src/Model/Photo.php
src/Model/Post.php
src/Model/Post/Link.php
src/Model/Post/Media.php
src/Model/Profile.php
src/Model/Tag.php
src/Model/User.php
src/Module/Contact.php
src/Module/Special/HTTPException.php
src/Navigation/Notifications/Repository/Notify.php
src/Network/Factory/MimeType.php
src/Network/HTTPClient/Client/HttpClient.php
src/Network/Probe.php
src/Protocol/ActivityPub/Processor.php
src/Protocol/ActivityPub/Queue.php
src/Protocol/ActivityPub/Receiver.php
src/Protocol/ActivityPub/Transmitter.php
src/Protocol/Diaspora.php
src/Protocol/Diaspora/Repository/DiasporaContact.php
src/Util/Crypto.php
src/Util/JsonLD.php
src/Util/Proxy.php
src/Util/Strings.php
src/Util/XML.php

index dc7aaedd90b5e550c464e05d8e5c848fa66ce138..c04b835c52ff4bb324c388dae1ebc940ffbc5a88 100644 (file)
@@ -33,7 +33,6 @@ use Friendica\Module\Response;
 use Friendica\Module\Special\HTTPException as ModuleHTTPException;
 use Friendica\Network\HTTPException;
 use Friendica\Util\Profiler;
-use Friendica\Util\XML;
 use Psr\Http\Message\ResponseInterface;
 use Psr\Log\LoggerInterface;
 
@@ -494,7 +493,7 @@ abstract class BaseModule implements ICanHandleRequests
        public function httpError(int $httpCode, string $message = '', $content = '')
        {
                if ($httpCode >= 400) {
-                       $this->logger->debug('Exit with error', ['code' => $httpCode, 'message' => $message, 'callstack' => System::callstack(20), 'method' => $this->args->getMethod(), 'agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
+                       $this->logger->debug('Exit with error', ['code' => $httpCode, 'message' => $message, 'method' => $this->args->getMethod(), 'agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
                }
 
                $this->response->setStatus($httpCode, $message);
@@ -529,7 +528,7 @@ abstract class BaseModule implements ICanHandleRequests
        public function jsonError(int $httpCode, $content, string $content_type = 'application/json')
        {
                if ($httpCode >= 400) {
-                       $this->logger->debug('Exit with error', ['code' => $httpCode, 'content_type' => $content_type, 'callstack' => System::callstack(20), 'method' => $this->args->getMethod(), 'agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
+                       $this->logger->debug('Exit with error', ['code' => $httpCode, 'content_type' => $content_type, 'method' => $this->args->getMethod(), 'agent' => $this->server['HTTP_USER_AGENT'] ?? '']);
                }
 
                $this->response->setStatus($httpCode);
index 33e023bc03662b9f55bbec4913a12b6506d6463a..597a28221f37a75b10d64cec91ad0c04225c0a39 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Content\Text;
 
 use Friendica\Core\Logger;
-use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Model\Contact;
 
@@ -112,7 +111,7 @@ class Markdown
        {
                // @TODO Temporary until we find the source of the null value to finally set the correct type-hint
                if (is_null($s)) {
-                       Logger::warning('Received null value', ['callstack' => System::callstack()]);
+                       Logger::warning('Received null value');
                        return '';
                }
 
index 1d5cde87b4794cac65d532a94d3c2410e667e511..b568447e61b0a72fc621f7a084b1d6ff69075ec3 100644 (file)
@@ -26,7 +26,6 @@ use Friendica\Content\Text\BBCode;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
-use Friendica\Core\System;
 use Friendica\DI;
 use Friendica\Model\Contact;
 use Friendica\Util\Network;
@@ -48,7 +47,7 @@ class VCard
        public static function getHTML(array $contact): string
        {
                if (!isset($contact['network']) || !isset($contact['id'])) {
-                       Logger::warning('Incomplete contact', ['contact' => $contact ?? [], 'callstack' => System::callstack(20)]);
+                       Logger::warning('Incomplete contact', ['contact' => $contact ?? []]);
                }
 
                if (!Network::isValidHttpUrl($contact['url']) && Network::isValidHttpUrl($contact['alias'])) {
index 3b7d807f52ff2be83b709b202f3b908ea868cbc8..0698536e152ba8b11aacb612c39ebdc7de4c6b23 100644 (file)
@@ -87,7 +87,7 @@ class Introspection implements IHaveCallIntrospections
                        'line'       => $trace[$i - 1]['line'] ?? null,
                        'function'   => $trace[$i]['function'] ?? null,
                        'request-id' => $this->requestId,
-                       'stack'      => System::callstack(10, 0, true, ['Friendica\Core\Logger\Type\StreamLogger', 'Friendica\Core\Logger\Type\AbstractLogger', 'Friendica\Core\Logger\Type\WorkerLogger', 'Friendica\Core\Logger']),
+                       'stack'      => System::callstack(15, 0, true, ['Friendica\Core\Logger\Type\StreamLogger', 'Friendica\Core\Logger\Type\AbstractLogger', 'Friendica\Core\Logger\Type\WorkerLogger', 'Friendica\Core\Logger']),
                ];
        }
 
index a51ffe0d1fda91fdfa9f83b6b2289e8f1d57e319..9e820dde5fb04cac1f922aa557153216aa00f510 100644 (file)
@@ -220,7 +220,7 @@ class System
 
                proc_close($resource);
 
-               $this->logger->info('Executed "proc_open"', ['command' => $cmdline, 'callstack' => System::callstack(10)]);
+               $this->logger->info('Executed "proc_open"', ['command' => $cmdline]);
        }
 
        /**
@@ -348,7 +348,7 @@ class System
        public static function httpError($httpCode, $message = '', $content = '')
        {
                if ($httpCode >= 400) {
-                       Logger::debug('Exit with error', ['code' => $httpCode, 'message' => $message, 'callstack' => System::callstack(20), 'method' => DI::args()->getMethod(), 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
+                       Logger::debug('Exit with error', ['code' => $httpCode, 'message' => $message, 'method' => DI::args()->getMethod(), 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
                }
                DI::apiResponse()->setStatus($httpCode, $message);
 
@@ -381,7 +381,7 @@ class System
        public static function jsonError($httpCode, $content, $content_type = 'application/json')
        {
                if ($httpCode >= 400) {
-                       Logger::debug('Exit with error', ['code' => $httpCode, 'content_type' => $content_type, 'callstack' => System::callstack(20), 'method' => DI::args()->getMethod(), 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
+                       Logger::debug('Exit with error', ['code' => $httpCode, 'content_type' => $content_type, 'method' => DI::args()->getMethod(), 'agent' => $_SERVER['HTTP_USER_AGENT'] ?? '']);
                }
                DI::apiResponse()->setStatus($httpCode);
                self::jsonExit($content, $content_type);
index c84b59e2b7324c5ec6838c3962706e3f306c54c9..0c6b67f855d72e814f16dd875852e21e6e24e0bf 100644 (file)
@@ -1276,7 +1276,7 @@ class Worker
                $added = 0;
 
                if (!is_int($priority) || !in_array($priority, self::PRIORITIES)) {
-                       Logger::warning('Invalid priority', ['priority' => $priority, 'command' => $command, 'callstack' => System::callstack(20)]);
+                       Logger::warning('Invalid priority', ['priority' => $priority, 'command' => $command]);
                        $priority = self::PRIORITY_MEDIUM;
                }
 
index 9366f1b31416e74e11d9ca6944fc3b1d229c1969..946c82f5c5776c48ebd63e5160f683564a712cc2 100644 (file)
@@ -528,7 +528,7 @@ class Database
 
                if ((substr_count($sql, '?') != count($args)) && (count($args) > 0)) {
                        // Question: Should we continue or stop the query here?
-                       $this->logger->warning('Query parameters mismatch.', ['query' => $sql, 'args' => $args, 'callstack' => System::callstack()]);
+                       $this->logger->warning('Query parameters mismatch.', ['query' => $sql, 'args' => $args]);
                }
 
                $sql = DBA::cleanQuery($sql);
@@ -702,7 +702,6 @@ class Database
                        $this->logger->error('DB Error', [
                                'code'      => $errorno,
                                'error'     => $error,
-                               'callstack' => System::callstack(8),
                                'params'    => $this->replaceParameters($sql, $args),
                        ]);
 
@@ -810,7 +809,6 @@ class Database
                        $this->logger->error('DB Error', [
                                'code'      => $errorno,
                                'error'     => $error,
-                               'callstack' => System::callstack(8),
                                'params'    => $this->replaceParameters($sql, $params),
                        ]);
 
@@ -1292,7 +1290,7 @@ class Database
                $condition_string = DBA::buildCondition($conditions);
 
                $sql = "DELETE FROM " . $table_string . " " . $condition_string;
-               $this->logger->debug($this->replaceParameters($sql, $conditions), ['callstack' => System::callstack(6)]);
+               $this->logger->debug($this->replaceParameters($sql, $conditions));
                return $this->e($sql, $conditions);
        }
 
index 5434bf584fa51df2455f1be2d883478194a4e2e0..ff151e469e119b579e9edc1442eeabe0818b88ac 100644 (file)
@@ -176,7 +176,7 @@ class APContact
                $cachekey = 'apcontact:' . ItemURI::getIdByURI($url);
                $result = DI::cache()->get($cachekey);
                if (!is_null($result)) {
-                       Logger::info('Multiple requests for the address', ['url' => $url, 'update' => $update, 'callstack' => System::callstack(20), 'result' => $result]);
+                       Logger::info('Multiple requests for the address', ['url' => $url, 'update' => $update, 'result' => $result]);
                        if (!empty($fetched_contact)) {
                                return $fetched_contact;
                        }
index be3cec47014a23204e5280bcece7eb85aec05dd3..d2e04c998e0c570250e26f373b3d4574eaba505d 100644 (file)
@@ -1081,7 +1081,7 @@ class Contact
                                return;
                        }
                } elseif (!isset($contact['url'])) {
-                       Logger::info('Empty contact', ['contact' => $contact, 'callstack' => System::callstack(20)]);
+                       Logger::info('Empty contact', ['contact' => $contact]);
                }
 
                Logger::info('Contact is marked for archival', ['id' => $contact['id'], 'term-date' => $contact['term-date']]);
@@ -1366,7 +1366,7 @@ class Contact
                        }
 
                        if (DBA::isResult($personal_contact)) {
-                               Logger::info('Take contact data from personal contact', ['url' => $url, 'update' => $update, 'contact' => $personal_contact, 'callstack' => System::callstack(20)]);
+                               Logger::info('Take contact data from personal contact', ['url' => $url, 'update' => $update, 'contact' => $personal_contact]);
                                $data = $personal_contact;
                                $data['photo'] = $personal_contact['avatar'];
                                $data['account-type'] = $personal_contact['contact-type'];
@@ -1378,7 +1378,7 @@ class Contact
                }
 
                if (empty($data['network']) || ($data['network'] == Protocol::PHANTOM)) {
-                       Logger::notice('No valid network found', ['url' => $url, 'uid' => $uid, 'default' => $default, 'update' => $update, 'callstack' => System::callstack(20)]);
+                       Logger::notice('No valid network found', ['url' => $url, 'uid' => $uid, 'default' => $default, 'update' => $update]);
                        return 0;
                }
 
@@ -2576,7 +2576,7 @@ class Contact
                        Worker::add(Worker::PRIORITY_HIGH, 'MergeContact', $first, $duplicate['id'], $uid);
                }
                DBA::close($duplicates);
-               Logger::info('Duplicates handled', ['uid' => $uid, 'nurl' => $nurl, 'callstack' => System::callstack(20)]);
+               Logger::info('Duplicates handled', ['uid' => $uid, 'nurl' => $nurl]);
                return true;
        }
 
@@ -2599,7 +2599,7 @@ class Contact
 
                $stamp = (float)microtime(true);
                self::updateFromProbe($id);
-               Logger::debug('Contact data is updated.', ['duration' => round((float)microtime(true) - $stamp, 3), 'id' => $id, 'url' => $contact['url'], 'callstack' => System::callstack(20)]);
+               Logger::debug('Contact data is updated.', ['duration' => round((float)microtime(true) - $stamp, 3), 'id' => $id, 'url' => $contact['url']]);
                return true;
        }
 
@@ -2839,7 +2839,7 @@ class Contact
                        }
 
                        $ret['last-item'] = Probe::getLastUpdate($ret);
-                       Logger::info('Fetched last item', ['id' => $id, 'probed_url' => $ret['url'], 'last-item' => $ret['last-item'], 'callstack' => System::callstack(20)]);
+                       Logger::info('Fetched last item', ['id' => $id, 'probed_url' => $ret['url'], 'last-item' => $ret['last-item']]);
                }
 
                $update = false;
@@ -3370,7 +3370,7 @@ class Contact
                } elseif (!empty($contact['id'])) {
                        self::remove($contact['id']);
                } else {
-                       DI::logger()->info('Couldn\'t remove follower because of invalid contact array', ['contact' => $contact, 'callstack' => System::callstack()]);
+                       DI::logger()->info('Couldn\'t remove follower because of invalid contact array', ['contact' => $contact]);
                        return;
                }
 
index 651c4d005acf9571260ada23b1183786514eadcb..c86b1c6bea8d1aba1037a96ed35528a04cfbe4c8 100644 (file)
@@ -24,7 +24,6 @@ namespace Friendica\Model\Contact;
 use Exception;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
-use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -55,7 +54,7 @@ class User
                }
 
                if (empty($contact['uri-id']) && empty($contact['url'])) {
-                       Logger::info('Missing contact details', ['contact' => $contact, 'callstack' => System::callstack(20)]);
+                       Logger::info('Missing contact details', ['contact' => $contact]);
                        return false;
                }
 
index 758ff0f13538da8020e524da74d6a3b02d45f2d5..43788148542093919ce4b6cbc7175565cf99cc75 100644 (file)
@@ -26,7 +26,6 @@ use DOMXPath;
 use Exception;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
-use Friendica\Core\System;
 use Friendica\Core\Worker;
 use Friendica\Database\Database;
 use Friendica\Database\DBA;
@@ -126,7 +125,7 @@ class GServer
 
                $gserver = DBA::selectFirst('gserver', ['id'], ['nurl' => Strings::normaliseLink($url)]);
                if (DBA::isResult($gserver)) {
-                       Logger::debug('Got ID for URL', ['id' => $gserver['id'], 'url' => $url, 'callstack' => System::callstack(20)]);
+                       Logger::debug('Got ID for URL', ['id' => $gserver['id'], 'url' => $url]);
 
                        if (Network::isUrlBlocked($url)) {
                                self::setBlockedById($gserver['id']);
@@ -2515,7 +2514,7 @@ class GServer
                        }
                }
 
-               Logger::info('Protocol for server', ['protocol' => $protocol, 'old' => $old, 'id' => $gsid, 'url' => $gserver['url'], 'callstack' => System::callstack(20)]);
+               Logger::info('Protocol for server', ['protocol' => $protocol, 'old' => $old, 'id' => $gsid, 'url' => $gserver['url']]);
                self::update(['protocol' => $protocol], ['id' => $gsid]);
        }
 
index 5f83ae38dad2e6f030602c91735fc4e91ab14a59..04853314f5b90adf34659439982307c53ac6ef36 100644 (file)
@@ -330,7 +330,7 @@ class Item
         */
        public static function markForDeletionById(int $item_id, int $priority = Worker::PRIORITY_HIGH): bool
        {
-               Logger::info('Mark item for deletion by id', ['id' => $item_id, 'callstack' => System::callstack()]);
+               Logger::info('Mark item for deletion by id', ['id' => $item_id]);
                // locate item to be deleted
                $fields = [
                        'id', 'uri', 'uri-id', 'uid', 'parent', 'parent-uri-id', 'origin',
@@ -795,7 +795,7 @@ class Item
                }
 
                if (!DBA::isResult($parent)) {
-                       Logger::notice('item parent was not found - ignoring item', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid'], 'callstack' => System::callstack(20)]);
+                       Logger::notice('item parent was not found - ignoring item', ['uri-id' => $item['uri-id'], 'thr-parent-id' => $item['thr-parent-id'], 'uid' => $item['uid']]);
                        return [];
                }
 
@@ -1183,7 +1183,7 @@ class Item
                        if (!empty($quote_id)) {
                                // This is one of these "should not happen" situations.
                                // The protocol implementations should already have done this job.
-                               Logger::notice('Quote-uri-id detected in post', ['id' => $quote_id, 'guid' => $item['guid'], 'uri-id' => $item['uri-id'], 'callstack' => System::callstack(20)]);
+                               Logger::notice('Quote-uri-id detected in post', ['id' => $quote_id, 'guid' => $item['guid'], 'uri-id' => $item['uri-id']]);
                                $item['quote-uri-id'] = $quote_id;
                        }
                }
@@ -2162,7 +2162,7 @@ class Item
 
                $hostPart = $host ?: $parsed['host'] ?? '';
                if (!$hostPart) {
-                       Logger::warning('Empty host GUID part', ['uri' => $uri, 'host' => $host, 'parsed' => $parsed, 'callstack' => System::callstack(10)]);
+                       Logger::warning('Empty host GUID part', ['uri' => $uri, 'host' => $host, 'parsed' => $parsed]);
                }
 
                // Glue it together to be able to make a hash from it
index cae035f36e46f2cbd0ded9130091c079585b917a..92b65957a6d20a9fc2e5287ccec0a05510353179 100644 (file)
@@ -589,7 +589,7 @@ class Photo
                $photo_failure = false;
 
                if (!Network::isValidHttpUrl($image_url)) {
-                       Logger::warning('Invalid image url', ['image_url' => $image_url, 'uid' => $uid, 'cid' => $cid, 'callstack' => System::callstack(20)]);
+                       Logger::warning('Invalid image url', ['image_url' => $image_url, 'uid' => $uid, 'cid' => $cid]);
                        return false;
                }
 
index 323b307fcdde13de0b76a7cf0862120e54a80bd4..2e8bbe22e3650fdc7ffd265f5c3428d37b2b608d 100644 (file)
@@ -23,7 +23,6 @@ namespace Friendica\Model;
 
 use BadMethodCallException;
 use Friendica\Core\Logger;
-use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -611,7 +610,7 @@ class Post
        {
                $affected = 0;
 
-               Logger::info('Start Update', ['fields' => $fields, 'condition' => $condition, 'uid' => DI::userSession()->getLocalUserId(),'callstack' => System::callstack(10)]);
+               Logger::info('Start Update', ['fields' => $fields, 'condition' => $condition, 'uid' => DI::userSession()->getLocalUserId()]);
 
                // Don't allow changes to fields that are responsible for the relation between the records
                unset($fields['id']);
index 3fafdd7eaf7b93f04e175b7124600be812dcec9f..87bc457524ede28dcb820b086dfbad969be5c74e 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Model\Post;
 
 use Friendica\Core\Logger;
-use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -67,7 +66,7 @@ class Link
                }
 
                if (!in_array(parse_url($url, PHP_URL_SCHEME), ['http', 'https'])) {
-                       Logger::info('Bad URL, quitting', ['uri-id' => $uriId, 'url' => $url, 'callstack' => System::callstack(20)]);
+                       Logger::info('Bad URL, quitting', ['uri-id' => $uriId, 'url' => $url]);
                        return $url;
                }
 
index 538c75091f5ae36c3a91dfb06d725dab89dac411..4ba67de9a82dadfebc92bc6459672c1fcc98d23e 100644 (file)
@@ -25,7 +25,6 @@ use Friendica\Content\PageInfo;
 use Friendica\Content\Text\BBCode;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
-use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -79,7 +78,7 @@ class Media
                }
 
                if (DBA::exists('post-media', ['uri-id' => $media['uri-id'], 'preview' => $media['url']])) {
-                       Logger::info('Media already exists as preview', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'callstack' => System::callstack()]);
+                       Logger::info('Media already exists as preview', ['uri-id' => $media['uri-id'], 'url' => $media['url']]);
                        return false;
                }
 
@@ -87,12 +86,12 @@ class Media
                // and embedded as picture then we only store the picture or replace the document
                $found = DBA::selectFirst('post-media', ['type'], ['uri-id' => $media['uri-id'], 'url' => $media['url']]);
                if (!$force && !empty($found) && (($found['type'] != self::DOCUMENT) || ($media['type'] == self::DOCUMENT))) {
-                       Logger::info('Media already exists', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'callstack' => System::callstack()]);
+                       Logger::info('Media already exists', ['uri-id' => $media['uri-id'], 'url' => $media['url']]);
                        return false;
                }
 
                if (!ItemURI::exists($media['uri-id'])) {
-                       Logger::info('Media referenced URI ID not found', ['uri-id' => $media['uri-id'], 'url' => $media['url'], 'callstack' => System::callstack()]);
+                       Logger::info('Media referenced URI ID not found', ['uri-id' => $media['uri-id'], 'url' => $media['url']]);
                        return false;
                }
 
@@ -102,7 +101,7 @@ class Media
                // We are storing as fast as possible to avoid duplicated network requests
                // when fetching additional information for pictures and other content.
                $result = DBA::insert('post-media', $media, Database::INSERT_UPDATE);
-               Logger::info('Stored media', ['result' => $result, 'media' => $media, 'callstack' => System::callstack()]);
+               Logger::info('Stored media', ['result' => $result, 'media' => $media]);
                $stored = $media;
 
                $media = self::fetchAdditionalData($media);
index c2b21e904bcaccc173e7fae8b23d1b72a52c4584..373acbc17370fed78e24639fc61d20728f022278 100644 (file)
@@ -228,7 +228,7 @@ class Profile
 
                // System user, aborting
                if ($profile['uid'] === 0) {
-                       DI::logger()->warning('System user found in Profile::load', ['nickname' => $nickname, 'callstack' => System::callstack(20)]);
+                       DI::logger()->warning('System user found in Profile::load', ['nickname' => $nickname]);
                        throw new HTTPException\NotFoundException(DI::l10n()->t('User not found.'));
                }
 
@@ -450,7 +450,7 @@ class Profile
                $p['url'] = Contact::magicLinkById($cid, $profile['url']);
 
                if (!isset($profile['hidewall'])) {
-                       Logger::warning('Missing hidewall key in profile array', ['profile' => $profile, 'callstack' => System::callstack(10)]);
+                       Logger::warning('Missing hidewall key in profile array', ['profile' => $profile]);
                }
 
                if ($profile['account-type'] == Contact::TYPE_COMMUNITY) {
index 04f3f1627eae8249706192bce0b3f44e1ec34780..3758e065d30631dd1e0bee2f9376757d5d0194ad 100644 (file)
@@ -112,7 +112,7 @@ class Tag
                        }
 
                        if ((substr($url, 0, 7) == 'https//') || (substr($url, 0, 6) == 'http//')) {
-                               Logger::notice('Wrong scheme in url', ['url' => $url, 'callstack' => System::callstack(20)]);
+                               Logger::notice('Wrong scheme in url', ['url' => $url]);
                        }
 
                        $cid = Contact::getIdForURL($url, 0, false);
@@ -159,7 +159,7 @@ class Tag
 
                DBA::insert('post-tag', $fields, Database::INSERT_IGNORE);
 
-               Logger::debug('Stored tag/mention', ['uri-id' => $uriId, 'tag-id' => $tagid, 'contact-id' => $cid, 'name' => $name, 'type' => $type, 'callstack' => System::callstack(8)]);
+               Logger::debug('Stored tag/mention', ['uri-id' => $uriId, 'tag-id' => $tagid, 'contact-id' => $cid, 'name' => $name, 'type' => $type]);
        }
 
        /**
@@ -316,7 +316,7 @@ class Tag
         */
        public static function storeFromArray(array $item, string $tags = null)
        {
-               Logger::info('Check for tags', ['uri-id' => $item['uri-id'], 'hash' => $tags, 'callstack' => System::callstack()]);
+               Logger::info('Check for tags', ['uri-id' => $item['uri-id'], 'hash' => $tags]);
 
                if (is_null($tags)) {
                        $tags = self::TAG_CHARACTER[self::HASHTAG] . self::TAG_CHARACTER[self::MENTION] . self::TAG_CHARACTER[self::EXCLUSIVE_MENTION];
@@ -347,7 +347,7 @@ class Tag
         */
        public static function storeRawTagsFromBody(int $uriId, string $body)
        {
-               Logger::info('Check for tags', ['uri-id' => $uriId, 'callstack' => System::callstack()]);
+               Logger::info('Check for tags', ['uri-id' => $uriId]);
 
                $result = BBCode::getTags($body);
                if (empty($result)) {
@@ -396,7 +396,7 @@ class Tag
                        return;
                }
 
-               Logger::debug('Removing tag/mention', ['uri-id' => $uriId, 'tid' => $tag['tid'], 'name' => $name, 'url' => $url, 'callstack' => System::callstack(8)]);
+               Logger::debug('Removing tag/mention', ['uri-id' => $uriId, 'tid' => $tag['tid'], 'name' => $name, 'url' => $url]);
                DBA::delete('post-tag', ['uri-id' => $uriId, 'type' => $type, 'tid' => $tag['tid'], 'cid' => $tag['cid']]);
        }
 
index f985dc2a67cce1480349a1b8d30d37f0e4e61189..18fecf080380d4e0c9f6a6df7cb1f9bcea1763ee 100644 (file)
@@ -962,7 +962,7 @@ class User
        public static function getAvatarUrl(array $user, string $size = ''): string
        {
                if (empty($user['nickname'])) {
-                       DI::logger()->warning('Missing user nickname key', ['trace' => System::callstack(20)]);
+                       DI::logger()->warning('Missing user nickname key');
                }
 
                $url = DI::baseUrl() . '/photo/';
@@ -1004,7 +1004,7 @@ class User
        public static function getBannerUrl(array $user): string
        {
                if (empty($user['nickname'])) {
-                       DI::logger()->warning('Missing user nickname key', ['trace' => System::callstack(20)]);
+                       DI::logger()->warning('Missing user nickname key');
                }
 
                $url = DI::baseUrl() . '/photo/banner/';
index 6e480c19318f9f98b37fc5f627b8718e77bd1fec..8480a7416ba4696410d2db2b2fed44e3be2944e3 100644 (file)
@@ -29,7 +29,6 @@ use Friendica\Content\Widget;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
 use Friendica\Core\Renderer;
-use Friendica\Core\System;
 use Friendica\Core\Theme;
 use Friendica\Core\Worker;
 use Friendica\Database\DBA;
@@ -140,7 +139,7 @@ class Contact extends BaseModule
                        try {
                                UpdateContact::add(Worker::PRIORITY_HIGH, $contact_id);
                        } catch (\InvalidArgumentException $e) {
-                               Logger::notice($e->getMessage(), ['contact' => $contact, 'callstack' => System::callstack()]);
+                               Logger::notice($e->getMessage(), ['contact' => $contact]);
                        }
                }
        }
index f9468e20bc56eade9b87175ef8fc09baa85ab770..571c16935c7e230d203eb600a07cd918be911080 100644 (file)
@@ -138,7 +138,6 @@ class HTTPException
                                        'code'        => $e->getCode(),
                                        'description' => $e->getDescription(),
                                        'query'       => $this->args->getQueryString(),
-                                       'callstack'   => System::callstack(20),
                                        'method'      => $this->args->getMethod(),
                                        'agent'       => $this->server['HTTP_USER_AGENT'] ?? ''
                                ]);
index 2cacaa728fc18a7735aebdc62af726656303f5d0..2f2b0df7daeb9758fe6fff26e644ece15f2a1dd4 100644 (file)
@@ -226,7 +226,7 @@ class Notify extends BaseRepository
 
                // Temporary logging for finding the origin
                if (!isset($params['uid'])) {
-                       $this->logger->notice('Missing parameters "uid".', ['params' => $params, 'callstack' => System::callstack()]);
+                       $this->logger->notice('Missing parameters "uid".', ['params' => $params]);
                }
 
                // Ensure that the important fields are set at any time
index eb096582c6c80640518c1e6054a4da28a9ea2e78..ec76eb84400f07c0059156b3288abf543c0cafb9 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Network\Factory;
 
 use Friendica\BaseFactory;
-use Friendica\Core\System;
 use Friendica\Network\Entity;
 
 /**
@@ -43,7 +42,7 @@ class MimeType extends BaseFactory
                                $filetype = strtolower($types[0]);
                                $subtype = strtolower($types[1]);
                        } else {
-                               $this->logger->notice('Unknown MimeType', ['type' => $contentType, 'callstack' => System::callstack(10)]);
+                               $this->logger->notice('Unknown MimeType', ['type' => $contentType]);
                        }
 
                        $parameters = [];
index d608774eca377463c707b6a7ed0bb0c049638870..bc22aded8bbc01b8deda13daf559842c6618ff3b 100644 (file)
@@ -74,17 +74,17 @@ class HttpClient implements ICanSendHttpRequests
                }
 
                if(!filter_var($host, FILTER_VALIDATE_IP) && !@dns_get_record($host . '.', DNS_A + DNS_AAAA)) {
-                       $this->logger->debug('URL cannot be resolved.', ['url' => $url, 'callstack' => System::callstack(20)]);
+                       $this->logger->debug('URL cannot be resolved.', ['url' => $url]);
                        $this->profiler->stopRecording();
                        return CurlResult::createErrorCurl($this->logger, $url);
                }
 
                if (Network::isLocalLink($url)) {
-                       $this->logger->info('Local link', ['url' => $url, 'callstack' => System::callstack(20)]);
+                       $this->logger->info('Local link', ['url' => $url]);
                }
 
                if (strlen($url) > 1000) {
-                       $this->logger->debug('URL is longer than 1000 characters.', ['url' => $url, 'callstack' => System::callstack(20)]);
+                       $this->logger->debug('URL is longer than 1000 characters.', ['url' => $url]);
                        $this->profiler->stopRecording();
                        return CurlResult::createErrorCurl($this->logger, substr($url, 0, 200));
                }
@@ -160,7 +160,7 @@ class HttpClient implements ICanSendHttpRequests
                };
 
                if (empty($conf[HttpClientOptions::HEADERS]['Accept']) && in_array($method, ['get', 'head'])) {
-                       $this->logger->info('Accept header was missing, using default.', ['url' => $url, 'callstack' => System::callstack()]);
+                       $this->logger->info('Accept header was missing, using default.', ['url' => $url]);
                        $conf[HttpClientOptions::HEADERS]['Accept'] = HttpClientAccept::DEFAULT;
                }
 
@@ -238,7 +238,7 @@ class HttpClient implements ICanSendHttpRequests
                $this->profiler->startRecording('network');
 
                if (Network::isLocalLink($url)) {
-                       $this->logger->debug('Local link', ['url' => $url, 'callstack' => System::callstack(20)]);
+                       $this->logger->debug('Local link', ['url' => $url]);
                }
 
                if (Network::isUrlBlocked($url)) {
index a0887d5cba877cb5187acccdf6c09017c261b1a6..d5a0e285d5387fc9a296f6e398338ee08c6c19e4 100644 (file)
@@ -27,7 +27,6 @@ use Exception;
 use Friendica\Core\Hook;
 use Friendica\Core\Logger;
 use Friendica\Core\Protocol;
-use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
 use Friendica\Model\Contact;
@@ -219,7 +218,7 @@ class Probe
 
                $xrd_timeout = DI::config()->get('system', 'xrd_timeout', 20);
 
-               Logger::info('Probing', ['host' => $host, 'ssl_url' => $ssl_url, 'url' => $url, 'callstack' => System::callstack(20)]);
+               Logger::info('Probing', ['host' => $host, 'ssl_url' => $ssl_url, 'url' => $url]);
                $xrd = null;
 
                $curlResult = DI::httpClient()->get($ssl_url, HttpClientAccept::XRD_XML, [HttpClientOptions::TIMEOUT => $xrd_timeout]);
index f8c2c4b82b075eccd929caedd4793f0145edd863..df19ab8b8ffd152fea35aa1df61d1bd31e0cc028 100644 (file)
@@ -42,7 +42,6 @@ use Friendica\Model\Mail;
 use Friendica\Model\Tag;
 use Friendica\Model\User;
 use Friendica\Model\Post;
-use Friendica\Moderation\Entity\Report;
 use Friendica\Protocol\Activity;
 use Friendica\Protocol\ActivityPub;
 use Friendica\Protocol\Delivery;
@@ -472,7 +471,7 @@ class Processor
                $item['uri'] = $activity['id'];
 
                if (empty($activity['published']) || empty($activity['updated'])) {
-                       DI::logger()->notice('published or updated keys are empty for activity', ['activity' => $activity, 'callstack' => System::callstack(10)]);
+                       DI::logger()->notice('published or updated keys are empty for activity', ['activity' => $activity]);
                }
 
                $item['created'] = DateTimeFormat::utc($activity['published'] ?? 'now');
index beb8817bfbdfaa65f15ee15fe6dc299b07a5e865..47c8e632a75230437543698054b47e19ba0129cf 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Protocol\ActivityPub;
 
 use Friendica\Core\Logger;
-use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -214,7 +213,7 @@ class Queue
                        }
                }
 
-               Logger::debug('Processing queue entry', ['id' => $entry['id'], 'type' => $entry['type'], 'object-type' => $entry['object-type'], 'uri' => $entry['object-id'], 'in-reply-to' => $entry['in-reply-to-id'], 'callstack' => System::callstack(20)]);
+               Logger::debug('Processing queue entry', ['id' => $entry['id'], 'type' => $entry['type'], 'object-type' => $entry['object-type'], 'uri' => $entry['object-id'], 'in-reply-to' => $entry['in-reply-to-id']]);
 
                $activity = json_decode($entry['activity'], true);
                $type     = $entry['type'];
index 4990c03cfd21d8be3abfc2b70bea839eeac5805c..567fe3b86f916a33bc460b34a1e44f9a2dd25d02 100644 (file)
@@ -625,7 +625,7 @@ class Receiver
                // $trust_source is called by reference and is set to true if the content was retrieved successfully
                $object_data = self::prepareObjectData($activity, $uid, $push, $trust_source, $original_actor);
                if (empty($object_data)) {
-                       Logger::info('No object data found', ['activity' => $activity, 'callstack' => System::callstack(20)]);
+                       Logger::info('No object data found', ['activity' => $activity]);
                        return true;
                }
 
@@ -1077,7 +1077,7 @@ class Receiver
 
                        foreach ($receiver_list as $receiver) {
                                if ($receiver == 'Public') {
-                                       Logger::warning('Not compacted public collection found', ['activity' => $activity, 'callstack' => System::callstack(20)]);
+                                       Logger::warning('Not compacted public collection found', ['activity' => $activity]);
                                        $receiver = ActivityPub::PUBLIC_COLLECTION;
                                }
                                if ($receiver == self::PUBLIC_COLLECTION) {
@@ -1234,7 +1234,7 @@ class Receiver
                } elseif (empty($receivers) && in_array($activity_type, ['as:Delete', 'as:Undo'])) {
                        $receivers[0] = ['uid' => 0, 'type' => self::TARGET_GLOBAL];
                } elseif (empty($receivers)) {
-                       Logger::notice('Post has got no receivers', ['fetch_unlisted' => $fetch_unlisted, 'actor' => $actor, 'id' => JsonLD::fetchElement($activity, '@id'), 'type' => $activity_type, 'callstack' => System::callstack(20)]);
+                       Logger::notice('Post has got no receivers', ['fetch_unlisted' => $fetch_unlisted, 'actor' => $actor, 'id' => JsonLD::fetchElement($activity, '@id'), 'type' => $activity_type]);
                }
 
                return $receivers;
index 72a9c929fab53493d1e91adf97703ca3ea099e12..9e19724fa61b9512c1167f035374ec29e804a794 100644 (file)
@@ -347,7 +347,7 @@ class Transmitter
        {
                $owner = User::getOwnerDataById($uid);
                if (!isset($owner['id'])) {
-                       DI::logger()->error('Unable to find owner data for uid', ['uid' => $uid, 'callstack' => System::callstack(20)]);
+                       DI::logger()->error('Unable to find owner data for uid', ['uid' => $uid]);
                        throw new HTTPException\NotFoundException('User not found.');
                }
 
index 8bdb878abe10f90bcf0e551ce2fe0a5f826b7844..1aff0efb9575ce8676bfe4349d7657c255e5d953 100644 (file)
@@ -796,7 +796,7 @@ class Diaspora
         */
        private static function key(WebFingerUri $uri): string
        {
-               Logger::info('Fetching diaspora key', ['handle' => $uri->getAddr(), 'callstack' => System::callstack(20)]);
+               Logger::info('Fetching diaspora key', ['handle' => $uri->getAddr()]);
                try {
                        return DI::dsprContact()->getByAddr($uri)->pubKey;
                } catch (HTTPException\NotFoundException | \InvalidArgumentException $e) {
@@ -3022,7 +3022,7 @@ class Diaspora
                        // The "addr" field should always be filled.
                        // If this isn't the case, it will raise a notice some lines later.
                        // And in the log we will see where it came from, and we can handle it there.
-                       Logger::notice('Empty addr', ['contact' => $contact ?? [], 'callstack' => System::callstack(20)]);
+                       Logger::notice('Empty addr', ['contact' => $contact ?? []]);
                }
 
                $envelope = self::buildMessage($msg, $owner, $contact, $owner['uprvkey'], $pubkey ?? '', $public_batch);
index 142988bfdbffac74d6fb974cdb7460006137e1c2..3d2fa6641b91e8b96c77807428b8f7b9f36f97ce 100644 (file)
@@ -22,7 +22,6 @@
 namespace Friendica\Protocol\Diaspora\Repository;
 
 use Friendica\BaseRepository;
-use Friendica\Core\System;
 use Friendica\Database\Database;
 use Friendica\Database\Definition\DbaDefinition;
 use Friendica\Model\APContact;
@@ -273,7 +272,7 @@ class DiasporaContact extends BaseRepository
 
                $DiasporaContact = $this->save($DiasporaContact);
 
-               $this->logger->info('Updated diaspora-contact', ['url' => (string) $DiasporaContact->url, 'callstack' => System::callstack(20)]);
+               $this->logger->info('Updated diaspora-contact', ['url' => (string) $DiasporaContact->url]);
 
                return $DiasporaContact;
        }
index 1781dfb77988a0389484bed24cea973effe19c05..20ab9bc5288c19a28c4b16ea760d43c984b6930e 100644 (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));
        }
index 427205958f846d5bfa7ac101d751a88fba0d39bf..aa83d938a4f71cb248469dd120960362c382ea85 100644 (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]);
                        }
                }
index 9b160a1064725c95dfc48b08db4c6b181ade95ae..8d79b05dd8542507aedf11103ec2b28fee5a19b3 100644 (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) {
index bc1a0e4be991e751634c016ae1c5177ea06377bd..12503528fb480d8279bbe7ae8d448e8868c5e717 100644 (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) ?? '';
index c35f19b8a8e584619b4b14ca9ea8349c09d1da0e..e1910ce47d8256ee1bedbadbc11cc95ddc46eb77 100644 (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]);
                                }