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;
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);
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);
namespace Friendica\Content\Text;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use Friendica\DI;
use Friendica\Model\Contact;
{
// @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 '';
}
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;
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'])) {
'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']),
];
}
proc_close($resource);
- $this->logger->info('Executed "proc_open"', ['command' => $cmdline, 'callstack' => System::callstack(10)]);
+ $this->logger->info('Executed "proc_open"', ['command' => $cmdline]);
}
/**
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);
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);
$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;
}
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);
$this->logger->error('DB Error', [
'code' => $errorno,
'error' => $error,
- 'callstack' => System::callstack(8),
'params' => $this->replaceParameters($sql, $args),
]);
$this->logger->error('DB Error', [
'code' => $errorno,
'error' => $error,
- 'callstack' => System::callstack(8),
'params' => $this->replaceParameters($sql, $params),
]);
$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);
}
$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;
}
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']]);
}
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'];
}
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;
}
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;
}
$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;
}
}
$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;
} 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;
}
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;
}
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;
}
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;
$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']);
}
}
- 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]);
}
*/
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',
}
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 [];
}
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;
}
}
$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
$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;
}
use BadMethodCallException;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
{
$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']);
namespace Friendica\Model\Post;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
}
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;
}
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;
}
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;
}
// 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;
}
// 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);
// 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.'));
}
$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) {
}
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);
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]);
}
/**
*/
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];
*/
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)) {
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']]);
}
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/';
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/';
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;
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]);
}
}
}
'code' => $e->getCode(),
'description' => $e->getDescription(),
'query' => $this->args->getQueryString(),
- 'callstack' => System::callstack(20),
'method' => $this->args->getMethod(),
'agent' => $this->server['HTTP_USER_AGENT'] ?? ''
]);
// 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
namespace Friendica\Network\Factory;
use Friendica\BaseFactory;
-use Friendica\Core\System;
use Friendica\Network\Entity;
/**
$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 = [];
}
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));
}
};
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;
}
$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)) {
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;
$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]);
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;
$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');
namespace Friendica\Protocol\ActivityPub;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use Friendica\Database\Database;
use Friendica\Database\DBA;
use Friendica\DI;
}
}
- 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'];
// $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;
}
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) {
} 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;
{
$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.');
}
*/
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) {
// 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);
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;
$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;
}
use Friendica\Core\Hook;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use Friendica\DI;
use phpseclib3\Crypt\PublicKeyLoader;
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;
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));
}
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]);
}
}
$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) {
use Friendica\Content\ContactSelector;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use ParagonIE\ConstantTime\Base64;
/**
);
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) ?? '';
use DOMNode;
use DOMXPath;
use Friendica\Core\Logger;
-use Friendica\Core\System;
use SimpleXMLElement;
/**
$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]);
}