Re: real time output from log file?

From: Date: Mon, 17 Apr 2006 23:19:38 +0000
Subject: Re: real time output from log file?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-234139@lists.php.net to get a copy of this message
Richard Lynch wrote:
On Mon, April 17, 2006 11:45 am, Jason Gerfen wrote:
Anyone use php to tail a log file for patterns and perhaps updating a iframe or something similar? If so do you have a link to some resources on it?
No, but I don't see how you could make this much more complicated than: <html> <head><meta http-equiv="refresh" url="0;httpd_error_log_tail.php" /></head> <body bgcolor="#ffffff">
    <?php
      exec("tail /var/log/httpd/error_log", $output, $error);
      echo nl2br(htmlentities(implode("", $output)));
      if ($error) echo "<hr /><b>OS Error: $error</b>\n";
    ?>
</body> </html> But maybe I'm just too much a K.I.S.S. kind of guy...
which has nothing to do with the Oprah show about sex-addicts I just half-watched. :-)
Though why one wouldn't juse use SSH to do this in the first place is beyond me...
I second that.
But they had guys at an old job that did this, after I turned OFF display_output on their production server... [shudder]
I guess Richard's had another long day ... display_output? maybe display_errors? or was the stuff those guys produced so bad that a blank page was preferable? ;-)


« previous php.general (#234139) next »