I'm developing a web-based framework ("the application") and would like to implement an ncurses-based realtime monitoring facility ("the console").
The application currently writes events to a database history table, but I don't think having a console that constantly requeries that table would be efficient for monitoring realtime activity. So that's out. The most appealing method (in my mind) is to develop a socket protocol that allows the application to communicate with the console. The drawback here seems to be that the console will not usually be active, and I'm concerned that attempting to establish a connection will impose too much overhead since most often there will be nothing listening. The most viable solution I can dream up is writing events to a log file, and have the console (basically) "tail -f" that file to watch the online activity. The added value of this approach is a log file can be archived easily or analyzed offline without the need for a database. Potential drawbacks include the overhead of file I/O and file locking, etc. Interested to hear anyone's thoughts on either of these ideas (pros/cons) and/or any other ideas I've not considered (syslog? others?)... Has anyone done this before? Is there anything already available? If anyone else is interested, I would be willing to share the eventual technique and code with interested parties. TIA! --Kelly -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php