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

@ -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)) {