Random stuff, WIP, bits and pieces from a random web developer.
Logging your symfony exceptions with Codebase
Written around Aug 10, 2015 - tags: symfony and codebase
We previously saw how to log your deployments with codebase, I am now going to show you how to log the exceptions from a symfony project (2.3+) in your codebase!
If you look at your codebase project, you’ll see an “Exceptions” tab with some instructions about logging them. Find your codebase API key and create a listener in your symfony project to log the exceptions.
And now create a new listener in your src/App/MyBundle/Listener/ExceptionListener.php
You will notice that in this listener, I am using Airbrake library. You can easily include it in your composer.json:
And from your terminal, run a composer update - which will update your vendors folder with Airbrake.
And now, once you have deployed this code on your server and anything goes wrong - codebase will notify you and log it in the “Exceptions” tab.