I have my scheduler application running into a Docker container.
Laravel scheduler is managed and executed into the container with supervisor (I managed the output redirection by following http://veithen.github.io/2015/01/08/supervisord-redirecting-stdout.html):
[supervisord]
nodaemon = true
loglevel = info
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes = 0
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0
umask = 022
pidfile = /tmp/supervisord.pid,
logfile = /tmp/supervisord.log
[program:scheduler]
directory = /var/www
command = sh -c 'php artisan schedule:run && sleep 60'
autorestart = true
redirect_stderr = true
stdout_logfile = /dev/stdout
stdout_logfile_maxbytes = 0
stderr_logfile = /dev/stderr
stderr_logfile_maxbytes = 0
Adjusted My Kernel.php code to append output to stdout_logfile:
$fileCronLog = '/dev/stdout';
$schedule->command('test')->everyMinute()->appendOutputTo($fileCronLog);
test command is simply dumping a string to STDOUT.
If I set my $fileCronLog to a local storage file Writes correctly to file $filepath my command output.
But with $fileCronLog = '/dev/stdout';
I cant see my log. I also tried to enter the container to look at this file and it's always empty.