diff options
| author | 2019-01-06 00:46:48 +0100 | |
|---|---|---|
| committer | 2019-01-06 00:46:48 +0100 | |
| commit | 802c264574902ea44c2c76ae098a6f58911fe114 (patch) | |
| tree | db0082010f01f555244523adc2f2e0c27c363acc /lib | |
| parent | 20223b8b01f47fba0858d854c5744fad5900b9cc (diff) | |
Copy syslog to STDERR (#2208)
* Use openlog before syslog
In order to have a copy on stderr when syslog is not available.
* Take advantage of syslog for actualization
Pipe cron job STDERR and syslog to Docker log
Cf. https://github.com/FreshRSS/FreshRSS/pull/2202/commits/00bd467655b7c060cdae388519b2413d12d8cb0f
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/favicons.php | 1 | ||||
| -rw-r--r-- | lib/lib_install.php | 1 | ||||
| -rw-r--r-- | lib/lib_rss.php | 7 |
3 files changed, 9 insertions, 0 deletions
diff --git a/lib/favicons.php b/lib/favicons.php index fe2e65f1f..7a2d1187e 100644 --- a/lib/favicons.php +++ b/lib/favicons.php @@ -22,6 +22,7 @@ function isImgMime($content) { } function downloadHttp(&$url, $curlOptions = array()) { + prepareSyslog(); syslog(LOG_INFO, 'FreshRSS Favicon GET ' . $url); if (substr($url, 0, 2) === '//') { $url = 'https:' . $url; diff --git a/lib/lib_install.php b/lib/lib_install.php index d51a37e58..6e4df4e9c 100644 --- a/lib/lib_install.php +++ b/lib/lib_install.php @@ -81,6 +81,7 @@ function generateSalt() { function checkDb(&$dbOptions) { $dsn = ''; $driver_options = null; + prepareSyslog(); try { switch ($dbOptions['type']) { case 'mysql': diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 168309563..738ccf641 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -202,12 +202,19 @@ function html_only_entity_decode($text) { return strtr($text, $htmlEntitiesOnly); } +function prepareSyslog() { + return openlog("FreshRSS", LOG_PERROR | LOG_PID, LOG_USER); +} + function customSimplePie($attributes = array()) { $system_conf = Minz_Configuration::get('system'); $limits = $system_conf->limits; $simplePie = new SimplePie(); $simplePie->set_useragent(FRESHRSS_USERAGENT); $simplePie->set_syslog($system_conf->simplepie_syslog_enabled); + if ($system_conf->simplepie_syslog_enabled) { + prepareSyslog(); + } $simplePie->set_cache_location(CACHE_PATH); $simplePie->set_cache_duration($limits['cache_duration']); |
