dev-master
9999999-devEmail notify about errors and exceptions happened in production mode
MIT
The Requires
by Oleg Stepura
Wallogit.com
2017 © Pedro Peláez
Email notify about errors and exceptions happened in production mode
Render an error if IP is in allowed list or send an email on each error raised or exception thrown in production mode of a deployed symfony application (you should know that something went wrong)., (*1)
Install the bundle as usual. Enable the bundle in AppKernel for all modes:, (*2)
app/AppKernel.php, (*3)
``` php <?php $bundles = array( // ... new Ost\ErrorBundle\OstErrorBundle($this), // ... );, (*4)
Be sure to check that mail sending works with your current configuration. Now edit configuration files: `app/config/config.yml` ``` yaml ost_error: display: ips: ['10.10.10.2', '10.10.10.3']
Here we entered the IP's from which you are allowed to see the warning notifications on the site in production mode (in debug it's converted to exceptions by Symfony)., (*5)
app/config/config_dev.yml, (*6)
``` yaml ost_error: mailer: false display: true, (*7)
Disabled the mailer in dev mode since you are actually not going to recieve mails on errors while in dev mode. `app/config/config_prod.yml` ``` yaml ost_error: mailer: to: your.email@provider.com from: server.email@server.com report_not_found: false
Just enter your mail here. And tick the option if you want to recieve notifications
on NotFoundHttpException., (*8)
Email notify about errors and exceptions happened in production mode
MIT