Skip to content

A free, self-hostable news aggregator…

Respect simplepie_syslog_enabled for cache-hit debug logs (#8986)

Jam Balaya241c7fb42520
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index e9c4a4016..34943a15c 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -682,7 +682,9 @@ class FreshRSS_Feed extends Minz_Model {
$this->_attribute('SimplePieHash', $simplePie->get_hash());
return $simplePie;
}
- syslog(LOG_DEBUG, 'FreshRSS SimplePie uses cache for ' . $clean_url);
+ if (FreshRSS_Context::systemConf()->simplepie_syslog_enabled) {
+ syslog(LOG_DEBUG, 'FreshRSS SimplePie uses cache for ' . $clean_url);
+ }
}
}
return null;
diff --git a/app/Utils/httpUtil.php b/app/Utils/httpUtil.php
index a5b7f0120..39f9ae12d 100644
--- a/app/Utils/httpUtil.php
+++ b/app/Utils/httpUtil.php
@@ -431,7 +431,9 @@ final class FreshRSS_http_Util {
if ($cacheMtime !== false && $cacheMtime > time() - intval($limits['cache_duration'])) {
$body = @file_get_contents($cachePath);
if ($body != false) {
- syslog(LOG_DEBUG, 'FreshRSS uses cache for ' . \SimplePie\Misc::url_remove_credentials($url));
+ if (FreshRSS_Context::systemConf()->simplepie_syslog_enabled) {
+ syslog(LOG_DEBUG, 'FreshRSS uses cache for ' . \SimplePie\Misc::url_remove_credentials($url));
+ }
return ['body' => $body, 'effective_url' => $url, 'redirect_count' => 0, 'fail' => false, 'status' => -200, 'error' => ''];
}
}