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

@ -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');

View 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'];

View 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;

View 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.');
}

View 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);

View 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;
}