Some more changed log levels

This commit is contained in:
Michael 2022-08-31 05:01:22 +00:00
parent 757a5c2de9
commit f7b85092b0
14 changed files with 30 additions and 24 deletions

View file

@ -52,7 +52,7 @@ class Delivery
if ($result['serverfailure']) {
// In a timeout situation we assume that every delivery to that inbox will time out.
// So we set the flag and try all deliveries at a later time.
Logger::info('Inbox delivery has a server failure', ['inbox' => $inbox]);
Logger::notice('Inbox delivery has a server failure', ['inbox' => $inbox]);
$serverfail = true;
}
}
@ -151,7 +151,7 @@ class Delivery
}
Logger::info('Delivery failed', ['retcode' => $response->getReturnCode(), 'serverfailure' => $serverfail, 'drop' => $drop, 'runtime' => round($runtime, 3), 'uri-id' => $uri_id, 'uid' => $uid, 'item_id' => $item_id, 'cmd' => $cmd, 'inbox' => $inbox]);
Logger::notice('Delivery failed', ['retcode' => $response->getReturnCode(), 'serverfailure' => $serverfail, 'drop' => $drop, 'runtime' => round($runtime, 3), 'uri-id' => $uri_id, 'uid' => $uid, 'item_id' => $item_id, 'cmd' => $cmd, 'inbox' => $inbox]);
}
if ($uri_id) {
if ($success) {

View file

@ -357,7 +357,7 @@ class Processor
$item['diaspora_signed_text'] = $activity['diaspora:comment'] ?? '';
if (empty($conversation) && empty($activity['directmessage']) && ($item['gravity'] != GRAVITY_PARENT) && !Post::exists(['uri' => $item['thr-parent']])) {
Logger::info('Parent not found, message will be discarded.', ['thr-parent' => $item['thr-parent']]);
Logger::notice('Parent not found, message will be discarded.', ['thr-parent' => $item['thr-parent']]);
if (!$fetch_parents) {
Queue::remove($activity);
}
@ -657,6 +657,7 @@ class Processor
$activity['reply-to-id'] = $activity['object_id'];
$item = self::createItem($activity, false);
if (empty($item)) {
Logger::debug('Activity was not prepared', ['id' => $activity['object_id']]);
return;
}
@ -1304,7 +1305,7 @@ class Processor
$pcid = Contact::getIdForURL($url, 0, false);
if (empty($pcid)) {
Logger::info('Contact not found', ['contact' => $url]);
Logger::notice('Contact not found', ['contact' => $url]);
return;
}
@ -1364,7 +1365,7 @@ class Processor
public static function fetchCachedActivity(string $url, int $uid): array
{
$cachekey = self::CACHEKEY_FETCH_ACTIVITY . $uid . ':' . $url;
$cachekey = self::CACHEKEY_FETCH_ACTIVITY . $uid . ':' . hash('sha256', $url);
$object = DI::cache()->get($cachekey);
if (!is_null($object)) {

View file

@ -391,6 +391,7 @@ class Receiver
// Fetch the activity on Lemmy "Announce" messages (announces of activities)
if (($type == 'as:Announce') && in_array($object_type, array_merge(self::ACTIVITY_TYPES, ['as:Delete', 'as:Undo', 'as:Update']))) {
Logger::debug('Fetch announced activity', ['object' => $object_id]);
$data = Processor::fetchCachedActivity($object_id, $fetch_uid);
if (!empty($data)) {
$type = $object_type;
@ -590,6 +591,7 @@ class Receiver
// Lemmy is announcing activities.
// We are changing the announces into regular activities.
if (($type == 'as:Announce') && in_array($object_data['type'] ?? '', array_merge(self::ACTIVITY_TYPES, ['as:Delete', 'as:Undo', 'as:Update']))) {
Logger::debug('Change type of announce to activity', ['type' => $object_data['type']]);
$type = $object_data['type'];
}
@ -727,11 +729,13 @@ class Receiver
if (!Post::exists(['uri' => $object_data['id'], 'uid' => 0])) {
$item = ActivityPub\Processor::createItem($object_data, $fetch_parents);
if (empty($item)) {
Logger::debug('announced id was not created', ['id' => $object_data['id']]);
return false;
}
$item['post-reason'] = Item::PR_ANNOUNCEMENT;
ActivityPub\Processor::postItem($object_data, $item);
Logger::debug('Created announced id', ['id' => $object_data['id']]);
} else {
Logger::info('Announced id already exists', ['id' => $object_data['id']]);
Queue::remove($object_data);
@ -744,6 +748,7 @@ class Receiver
$announce_object_data['object_id'] = $object_data['object_id'];
$announce_object_data['object_type'] = $object_data['object_type'];
$announce_object_data['push'] = $push;
Logger::debug('Create announce activity', ['id' => $announce_object_data['id'], 'object_data' => $announce_object_data]);
if (!empty($object_data['raw'])) {
$announce_object_data['raw'] = $object_data['raw'];