I don't know if it will work but I would try something like this:
// Turn off output buffering
ini_set('output_buffering', 'off');
// Turn off PHP output compression
ini_set('zlib.output_compression', false);
// Implicitly flush the buffer(s)
ini_set('implicit_flush', true);
ob_implicit_flush(true);
// Clear, and turn off output buffering
while (ob_get_level() > 0) ob_end_clean();
system('docker logs server --follow');
system
directly sends output to the buffer, and ob_implicit_flush
will do a flush whenever output is sent. You may have to turn of gzip, and someother things.
I did do a -tail
once for a server log, but it was years ago so I can't remember how I did it. It was in an iFrame, so I could display it on a web page. I remember that.