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:
Playing with event dispatcher and Silex. Sending logs to a remote server.
October 22, 2013 @ 09:44:57

Gonzalo Ayuso as a new post today showing the results of some of his testing with the event dispatcher and Silex to send logs to a remote server.

Today I continue playing with event dispatcher and Silex. Now I want to send a detailed log of our Kernel events to a remote server. We can do it something similar with Monolog, but I want to implement one working example hacking a little bit the event dispatcher. Basically we're going to create one Logger class (implementing PSR-3 of course).

He includes the sample code defining a "Logger" class that takes whatever message sent to it and pushes it into a given socket resource. He also creates a provider for the logger to implement it in the example and registers it with the event dispatcher. He hooks it into the request, get controller, terminate and exception events. On the other side he uses React to make a basic server to listen on port 4000 for the incoming log data.

0 comments voice your opinion now!
silex event dispatcher remote server log logger psr3

Link: http://gonzalo123.com/2013/10/21/playing-with-event-dispatcher-and-silex-sending-logs-to-a-remote-server/

blog comments powered by Disqus

Similar Posts

Christopher Jones' Blog: Free: Experience Oracle, PHP & Ruby/Rails at Oracle HQ

Nikita Popov: Cooperative multitasking using coroutines (in PHP!)

Juozas Kaziukenas' Blog: Zend Server - complete PHP environment in minutes

Idrish Laxmidhar's Blog: How to send mail from Localhost with XAMPP and mercury/32

Zend Developer Zone: Announcing the February 2011 Zend Framework Bug-Hunt


Community Events





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


zendserver tips laravel symfony community deployment conference framework podcast introduction code release bugfix list language development series api interview threedevsandamaybe

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