Welcome to our renewed series “Interesting Symfony Bundles“. In the past we had a series of posts in our blog about symfony 1.x plugins that we found useful and interesting.
Symfony 2 has been around for quite some time. Instead of plugins, Symfony2 is extended using bundles, There are well over 1600 public bundles at knpbundles.com, so sometimes really interesting and good bundles are hard time find. So we will revive the old series but this time we will do it with bundles.
I am a big proponent of logging. Logging everything, not only using server log files, but also adding metrics to your application. I’ve talked about using StatsD and Graphite to create simple and powerful graphs of stuff that happens in your application.
StatsD is a simple server that receives statistics from clients and aggregates them. Graphite is an application that lets you create charts using your StatsD data. Using StatsD is super easy. There is a simple and good PHP library to send statistics over UDP to the StatsD server.
If you are using Symfony 2, using StatsD in your app is even easier thanks to the StatsDClientBundle bundle. It includes, a client for the etsy/Statsd API, a service, a Monolog Handler, and a series of Collectors in order to aggregate your personal data. Check out the installation instructions to see how easy is to get started.
We have been using StatsD here and there, but now we will incorporate this bundle to our composer configuration. And you should too.