dev-master
9999999-dev https://analogic.cz/Simple Symfony bundle for email alerting PHP exceptions and Javascript exceptions
MIT
The Requires
- php >=7.1
- symfony/symfony ^3.3
bundle symfony exception alert
Simple Symfony bundle for email alerting PHP exceptions and Javascript exceptions
Simple symfony bundle for reporting Request Exceptions, Command Exceptions and JS Exceptions to email. It's intended use is for applications running in production giving some valuable feedback when something wrong happens., (*1)
Notice: Alert Bundle uses internal symfony mailer service, so it must be properly set, (*2)
Run from terminal:, (*3)
$ composer require analogic/alert-bundle
Enable bundle in the kernel:, (*4)
<?php // app/AppKernel.php public function registerBundles() { $bundles = [ // ... new Analogic\AlertBundle\AnalogicAlertBundle(), ]; }
# app/config/config.yml analogic_alert: enabled: true prefix: "[PANIC] " from: email: "exception@source.com" name: "Alert Monkey" to: - "code_monkey1@example.com" - "code_monkey2@example.com" ignore: - Symfony\Component\HttpKernel\Exception\NotFoundHttpException - Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException
You might also want to disable alerts for DEV environment:, (*5)
# app/config/config_dev.yml analogic_alert: enabled: false
Insert this code into html header:, (*6)
<!-- base.html.twig --> <script>{{ javascript_error_listener() }}</script>
No settings needed. Commands in Symfony are run in DEV environment by default(?) so you might need add "-e prod" if you disabled alerting for DEV., (*7)
By default Symfony email configuration is to sent every email right away. For production is better to setup file spooling (see: https://symfony.com/doc/current/email/spool.html) with crond or better incron which does not slow down reporting., (*8)
Simple Symfony bundle for email alerting PHP exceptions and Javascript exceptions
MIT
bundle symfony exception alert