Debug-Messages and Logging with Monolog for PHP
Slides and example code of my ViennaPHP-Talk in October 2013.
- Demonstration, how to collect all debug and log information/messages from PHP with the MONOLOG Logger.
- Reintegration of this messages into PHP with PHP DebugBar.
- Message distribution with MQTT to a message server (MQ-Server).
- Demonstration of a proof of concept for the MQ-System for remote debugging and logging.
The example code can be the missing cookbook for Monolog, because you can find there examples and descriptions for many many features of Monolog.
- Monolog Logger: https://github.com/Seldaek/monolog
- PHPDebugBar: http://phpdebugbar.com
- MQTT-Server Mosca: http://mcollina.github.io/mosca/ (node.js)
- node.js for the MQTT-Server: http://nodejs.org
- MQTT-Client MQTT.app: https://itunes.apple.com/us/app/mqtt/id560697602?mt=12 for Mac OSX
- Create a project folder
- Install Composer
- Copy all files from code folder to your project folder
- Move file
/vendor/monolog/monolog/src/Monolog/Handler. It is the missing MQTT-Handler for Monolog.
- Run the examples in your browser or your IDE and enjoy it!
Feel free to share and use the code. If you want to use the slides for commercial purpose please ask me.