]> git.mxchange.org Git - friendica.git/commitdiff
Some loglevels are adjusted to more reasonablöe levels
authorMichael <heluecht@pirati.ca>
Thu, 16 Feb 2023 20:47:37 +0000 (20:47 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 16 Feb 2023 20:47:37 +0000 (20:47 +0000)
src/Core/System.php
src/Core/Worker.php
src/Model/APContact.php
src/Module/DFRN/Notify.php
src/Navigation/Notifications/Repository/Notification.php
src/Network/HTTPClient/Factory/HttpClient.php
src/Protocol/ActivityPub/Processor.php
src/Protocol/Diaspora.php
src/Util/HTTPSignature.php
src/Util/LDSignature.php

index 42f5ab36aef2c85e001dfe60ddbf337405648d9a..bbcb3ab09e676040dde145642eeae7ee255f65b5 100644 (file)
@@ -166,7 +166,7 @@ class System
                $load = System::currentLoad();
                if ($load) {
                        if (intval($load) > $maxsysload) {
-                               $this->logger->warning('system load for process too high.', ['load' => $load, 'process' => 'backend', 'maxsysload' => $maxsysload]);
+                               $this->logger->notice('system load for process too high.', ['load' => $load, 'process' => 'backend', 'maxsysload' => $maxsysload]);
                                return true;
                        }
                }
index 90bce0a88e5807df6fa0f9eed52829c6f4440fef..9d1fde85c903a97847972716ae027f490df46c4d 100644 (file)
@@ -141,7 +141,7 @@ class Worker
                                if (DI::lock()->acquire(self::LOCK_WORKER, 0)) {
                                // Count active workers and compare them with a maximum value that depends on the load
                                        if (self::tooMuchWorkers()) {
-                                               Logger::notice('Active worker limit reached, quitting.');
+                                               Logger::info('Active worker limit reached, quitting.');
                                                DI::lock()->release(self::LOCK_WORKER);
                                                return;
                                        }
@@ -188,7 +188,7 @@ class Worker
        {
                // Count active workers and compare them with a maximum value that depends on the load
                if (self::tooMuchWorkers()) {
-                       Logger::notice('Active worker limit reached, quitting.');
+                       Logger::info('Active worker limit reached, quitting.');
                        return false;
                }
 
@@ -511,7 +511,7 @@ class Worker
                while ($load = System::getLoadAvg($processes_cooldown != 0)) {
                        if (($load_cooldown > 0) && ($load['average1'] > $load_cooldown)) {
                                if (!$sleeping) {
-                                       Logger::notice('Load induced pre execution cooldown.', ['max' => $load_cooldown, 'load' => $load, 'called-by' => System::callstack(1)]);
+                                       Logger::info('Load induced pre execution cooldown.', ['max' => $load_cooldown, 'load' => $load, 'called-by' => System::callstack(1)]);
                                        $sleeping = true;
                                }
                                sleep(1);
@@ -519,7 +519,7 @@ class Worker
                        }
                        if (($processes_cooldown > 0) && ($load['scheduled'] > $processes_cooldown)) {
                                if (!$sleeping) {
-                                       Logger::notice('Process induced pre execution cooldown.', ['max' => $processes_cooldown, 'load' => $load, 'called-by' => System::callstack(1)]);
+                                       Logger::info('Process induced pre execution cooldown.', ['max' => $processes_cooldown, 'load' => $load, 'called-by' => System::callstack(1)]);
                                        $sleeping = true;
                                }
                                sleep(1);
@@ -529,7 +529,7 @@ class Worker
                }
 
                if ($sleeping) {
-                       Logger::notice('Cooldown ended.', ['max-load' => $load_cooldown, 'max-processes' => $processes_cooldown, 'load' => $load, 'called-by' => System::callstack(1)]);
+                       Logger::info('Cooldown ended.', ['max-load' => $load_cooldown, 'max-processes' => $processes_cooldown, 'load' => $load, 'called-by' => System::callstack(1)]);
                }
        }
 
@@ -814,7 +814,7 @@ class Worker
                                }
                        }
 
-                       Logger::notice('Load: ' . $load . '/' . $maxsysload . ' - processes: ' . $deferred . '/' . $active . '/' . $waiting_processes . $processlist . ' - maximum: ' . $queues . '/' . $maxqueues);
+                       Logger::info('Load: ' . $load . '/' . $maxsysload . ' - processes: ' . $deferred . '/' . $active . '/' . $waiting_processes . $processlist . ' - maximum: ' . $queues . '/' . $maxqueues);
 
                        // Are there fewer workers running as possible? Then fork a new one.
                        if (!DI::config()->get('system', 'worker_dont_fork', false) && ($queues > ($active + 1)) && self::entriesExists() && !self::systemLimitReached()) {
index 71446e9696f1d100cbc78a624834fbc64246655f..215d7e317dcf4a78b973942c87e1b7acc4e07607 100644 (file)
@@ -169,7 +169,7 @@ class APContact
                $cachekey = 'apcontact:' . ItemURI::getIdByURI($url);
                $result = DI::cache()->get($cachekey);
                if (!is_null($result)) {
-                       Logger::notice('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, 'callstack' => System::callstack(20), 'result' => $result]);
                        if (!empty($fetched_contact)) {
                                return $fetched_contact;
                        }
index 6001ae6dc02de2183e8f2c171eed4ae73ede998d..ce44dec80533fbf5d65c667839516c10efc95949 100644 (file)
@@ -80,7 +80,7 @@ class Notify extends BaseModule
                $msg = Diaspora::decodeRaw($postdata, '', true);
                if (!is_array($msg)) {
                        // We have to fail silently to be able to hand it over to the salmon parser
-                       $this->logger->warning('Diaspora::decodeRaw() has failed for some reason.');
+                       $this->logger->warning('Diaspora::decodeRaw() has failed for some reason.', ['post-data' => $postdata]);
                        return false;
                }
 
index 078346445fd56283c3991cee6554c6475f6b03b1..777832de6d18bcca1a46b1f7865f6e20a13fa577 100644 (file)
@@ -282,7 +282,7 @@ class Notification extends BaseRepository
                        'parent-uri-id' => $itemUriId,
                ];
 
-               $this->logger->notice('deleteForItem', ['conditionTarget' => $conditionTarget, 'conditionParent' => $conditionParent]);
+               $this->logger->info('deleteForItem', ['conditionTarget' => $conditionTarget, 'conditionParent' => $conditionParent]);
 
                return
                        $this->db->delete(self::$table_name, $conditionTarget)
index 20b999919fd399eb2931c332c7bf7b8a42372a5f..5d01d3e1268a86aabde5213a5303217eedf916c1 100644 (file)
@@ -83,7 +83,7 @@ class HttpClient extends BaseFactory
                        ResponseInterface $response,
                        UriInterface $uri
                ) use ($logger) {
-                       $logger->notice('Curl redirect.', ['url' => $request->getUri(), 'to' => $uri, 'method' => $request->getMethod()]);
+                       $logger->info('Curl redirect.', ['url' => $request->getUri(), 'to' => $uri, 'method' => $request->getMethod()]);
                };
 
                $userAgent = App::PLATFORM . " '" .
index 6836eafe3472f50a3a38657eed9db738fa053e9e..11267cfaf5435e026e3cb61458d27f0039351807 100644 (file)
@@ -505,7 +505,7 @@ class Processor
                $recursion_depth = $activity['recursion-depth'] ?? 0;
 
                if (!$in_background && ($recursion_depth < DI::config()->get('system', 'max_recursion_depth'))) {
-                       Logger::notice('Parent not found. Try to refetch it.', ['parent' => $activity['reply-to-id'], 'recursion-depth' => $recursion_depth]);
+                       Logger::info('Parent not found. Try to refetch it.', ['parent' => $activity['reply-to-id'], 'recursion-depth' => $recursion_depth]);
                        $result = self::fetchMissingActivity($activity['reply-to-id'], $activity, '', Receiver::COMPLETION_AUTO);
                        if (empty($result) && self::isActivityGone($activity['reply-to-id'])) {
                                Logger::notice('The activity is gone, the queue entry will be deleted', ['parent' => $activity['reply-to-id']]);
@@ -516,10 +516,10 @@ class Processor
                        } elseif (!empty($result)) {
                                $exists = Post::exists(['uri' => [$result, $activity['reply-to-id']]]);
                                if ($exists) {
-                                       Logger::notice('The activity has been fetched and created.', ['parent' => $result]);
+                                       Logger::info('The activity has been fetched and created.', ['parent' => $result]);
                                        return $result;
                                } elseif (DI::config()->get('system', 'fetch_by_worker') || DI::config()->get('system', 'decoupled_receiver')) {
-                                       Logger::notice('The activity has been fetched and will hopefully be created later.', ['parent' => $result]);
+                                       Logger::info('The activity has been fetched and will hopefully be created later.', ['parent' => $result]);
                                } else {
                                        Logger::notice('The activity exists but has not been created, the queue entry will be deleted.', ['parent' => $result]);
                                        if (!empty($activity['entry-id'])) {
@@ -1561,11 +1561,11 @@ class Processor
                }
 
                if (($completion == Receiver::COMPLETION_RELAY) && Queue::exists($url, 'as:Create')) {
-                       Logger::notice('Activity has already been queued.', ['url' => $url, 'object' => $activity['id']]);
+                       Logger::info('Activity has already been queued.', ['url' => $url, 'object' => $activity['id']]);
                } elseif (ActivityPub\Receiver::processActivity($ldactivity, json_encode($activity), $uid, true, false, $signer, '', $completion)) {
-                       Logger::notice('Activity had been fetched and processed.', ['url' => $url, 'entry' => $child['entry-id'] ?? 0, 'completion' => $completion, 'object' => $activity['id']]);
+                       Logger::info('Activity had been fetched and processed.', ['url' => $url, 'entry' => $child['entry-id'] ?? 0, 'completion' => $completion, 'object' => $activity['id']]);
                } else {
-                       Logger::notice('Activity had been fetched and will be processed later.', ['url' => $url, 'entry' => $child['entry-id'] ?? 0, 'completion' => $completion, 'object' => $activity['id']]);
+                       Logger::info('Activity had been fetched and will be processed later.', ['url' => $url, 'entry' => $child['entry-id'] ?? 0, 'completion' => $completion, 'object' => $activity['id']]);
                }
 
                return $activity['id'];
index fd000dbe8e90e42a318dd1331f64b5b870b3ab06..271b71b893e1b20120a93a5bcf2da293d0a14443 100644 (file)
@@ -792,7 +792,7 @@ class Diaspora
         */
        private static function key(WebFingerUri $uri): string
        {
-               Logger::notice('Fetching diaspora key', ['handle' => $uri->getAddr(), 'callstack' => System::callstack(20)]);
+               Logger::info('Fetching diaspora key', ['handle' => $uri->getAddr(), 'callstack' => System::callstack(20)]);
                try {
                        return DI::dsprContact()->getByAddr($uri)->pubKey;
                } catch (HTTPException\NotFoundException|\InvalidArgumentException $e) {
index 3936c70fcbcde95e62fec977c122050771e6f58f..f082fe32f79f7eb3f9f905a2f6bca2d22050b28e 100644 (file)
@@ -347,12 +347,13 @@ class HTTPSignature
                        if (!empty($gsid)) {
                                $insertFields['gsid'] = $gsid;
                        }
-                       if (!DBA::insert('inbox-status', $insertFields, Database::INSERT_IGNORE)) {
+                       DBA::insert('inbox-status', $insertFields, Database::INSERT_IGNORE);
+
+                       $status = DBA::selectFirst('inbox-status', [], ['url' => $url]);
+                       if (empty($status)) {
                                Logger::warning('Unable to insert inbox-status row', $insertFields);
                                return;
                        }
-
-                       $status = DBA::selectFirst('inbox-status', [], ['url' => $url]);
                }
 
                if ($success) {
index 359fbdf17d888259b52589e90952c97eb7b95830..8cfadb16dada19da23ac65ccf997bb610bd448af 100644 (file)
@@ -69,7 +69,7 @@ class LDSignature
                $dhash = self::hash(self::signableData($data));
 
                $x = Crypto::rsaVerify($ohash . $dhash, base64_decode($data['signature']['signatureValue']), $pubkey);
-               Logger::notice('LD-verify', ['verified' => (int)$x, 'actor' => $profile['url']]);
+               Logger::info('LD-verify', ['verified' => (int)$x, 'actor' => $profile['url']]);
 
                if (empty($x)) {
                        return false;