aboutsummaryrefslogtreecommitdiff
path: root/app/actualize_script.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-01-06 00:46:48 +0100
committerGravatar GitHub <noreply@github.com> 2019-01-06 00:46:48 +0100
commit802c264574902ea44c2c76ae098a6f58911fe114 (patch)
treedb0082010f01f555244523adc2f2e0c27c363acc /app/actualize_script.php
parent20223b8b01f47fba0858d854c5744fad5900b9cc (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 'app/actualize_script.php')
-rwxr-xr-xapp/actualize_script.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/app/actualize_script.php b/app/actualize_script.php
index ba9660a14..f1dec5640 100755
--- a/app/actualize_script.php
+++ b/app/actualize_script.php
@@ -12,6 +12,9 @@ if (defined('STDOUT')) {
fwrite(STDOUT, 'Starting feed actualization at ' . $begin_date->format('c') . "\n"); //Unbuffered
}
+prepareSyslog();
+syslog(LOG_INFO, 'FreshRSS Start feeds actualization...');
+
// Set the header params ($_GET) to call the FRSS application.
$_GET['c'] = 'feed';
$_GET['a'] = 'actualize';
@@ -64,7 +67,7 @@ foreach ($users as $user) {
if (!invalidateHttpCache()) {
Minz_Log::warning('FreshRSS write access problem in ' . join_path(USERS_PATH, $user, 'log.txt'), ADMIN_LOG);
if (defined('STDERR')) {
- fwrite(STDERR, 'Write access problem in ' . join_path(USERS_PATH, $user, 'log.txt') . "\n");
+ fwrite(STDERR, 'FreshRSS write access problem in ' . join_path(USERS_PATH, $user, 'log.txt') . "\n");
}
}
}
@@ -75,7 +78,8 @@ if (defined('STDOUT')) {
$end_date = date_create('now');
$duration = date_diff($end_date, $begin_date);
fwrite(STDOUT, 'Ending feed actualization at ' . $end_date->format('c') . "\n"); //Unbuffered
- fwrite(STDOUT, 'Feed actualizations took ' . $duration->format('%a day(s), %h hour(s), %i minute(s) and %s seconds') . ' for ' . count($users) . " users\n"); //Unbuffered
+ fwrite(STDOUT, 'Feed actualizations took ' . $duration->format('%a day(s), %h hour(s), %i minute(s) and %s seconds') . ' for ' . count($users) . " users\n"); //Unbuffered
}
echo 'End.', "\n";
ob_end_flush();
+syslog(LOG_INFO, 'FreshRSS feeds actualization done.');