News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Gonzalo Ayuso's Blog:
Real time monitoring PHP applications with websockets and node.js
May 09, 2011 @ 11:02:28

Gonzalo Ayuso has a new post to his blog today looking at a method you can use for real-time monitoring of your PHP applications with a combination of websockets and Node.js. The trick is to handle the PHP errors and send them over to a Node.js server for processing.

The inspection of the error logs is a common way to detect errors and bugs. We also can show errors on-screen within our developement server, or we even can use great tools like firePHP to show our PHP errors and warnings inside our firebug console. That's cool, but we only can see our session errors/warnings. If we want to see another's errors we need to inspect the error log. tail -f is our friend, but we need to surf against all the warnings of all sessions to see our desired ones. Because of that I want to build a tool to monitor my PHP applications in real-time.

The service will work similar to a chat server, sending messages one at a time to the remote server via a web client (HTML5-based) and some backend PHP. He includes all the code you'll need to create the HTTP and web socket server as well as the web client (with some Javascript) and some example server-side PHP. It throws an exception and catches it to send to the waiting Node.js server. A screencast is also included showing the full process. You can get the complete code for this example in this repository on Gonzalo's github account.

0 comments voice your opinion now!
nodejs realtime monitoring websockets javascript tutorial


blog comments powered by Disqus

Similar Posts

WaxJelly Blog: How to write a custom Smarty function in PHP

Christopher Jones' Blog: Upgrade PHP with Oracle Application Server on Linux

The Bakery: Four New Articles - Load Balancing, Request Info, UUID Behavior & Upload Thumbnails

Freek Lijten's Blog: OAuth, a practical introduction with examples using the Twitter API

Zend Developer Zone: The Standard PHP Library (SPL)


Community Events





Don't see your event here?
Let us know!


framework opinion release podcast laravel api refactor community interview unittest series code symfony2 introduction list testing language threedevsandamaybe developer install

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework