2017 © Pedro Peláez
 

symfony-bundle slack-exception-logger-bundle

Log symfony2 exceptions to a Slack channel

image

dopiaza/slack-exception-logger-bundle

Log symfony2 exceptions to a Slack channel

  • Thursday, July 12, 2018
  • by dopiaza
  • Repository
  • 1 Watchers
  • 4 Stars
  • 6,067 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 5 Versions
  • 7 % Grown

The README.md

Slack Exception Logger Bundle for Symfony2

This bundle allows exceptions thrown in a symfony2 app to be logged automatically to a Slack channel., (*1)

Alt text, (*2)

To use, you first need to set up an incoming webhook in Slack - you can do this at https://your_slack_instance.slack.com/services/new/incoming-webhook (replace your_slack_instance with whatever your particular Slack instance is called). Once you've done that, you'll be given a web hook URL - make a note of that, you'll need to add that to your config.yml file., (*3)

Install this bundle into your symfony app:, (*4)

$ composer require dopiaza/slack-exception-logger-bundle

Next, add the bundle to registerBundles in AppKernel.php:, (*5)

new Dopiaza\Slack\ExceptionLoggerBundle\DopiazaSlackExceptionLoggerBundle(),

And then set up your config.yml:, (*6)

dopiaza_slack_exception_logger:
    webhook: https://hooks.slack.com/services/T0000000/B000000000/000000000000000000
    botname: symfony-bot
    name: My Symfony Application
    environments:
        test:
            enabled: true
            color: '#992255'
            channel: symfony-exceptions
        prod:
            channel: symfony-exceptions
            exclude_exception:
                - Symfony\Component\HttpKernel\Exception\NotFoundHttpException

webhook is the URL of the incoming web hook for your Slack instance., (*7)

botname is the name of the user that message will be posted as in your Slack channel. It has no default value. If no value is specified, Slack will use the name specified in your incoming web hook integration., (*8)

name is the name of your symfony application. This is useful if you have multiple apps all posting to the same channel., (*9)

environments holds all environment-specific configuration settings. Usual environment values to include in here would be dev, test and prod. If the environment being used isn't listed in this section, no exceptions will be posted. You probably don't really want to list dev in here, as that one is likely to generate quite a bit of noise, but hey, it's your choice., (*10)

enabled is an optional boolean to allow logging to be enabled or disabled on a per-channel basis. If not specified, it defaults to true., (*11)

color is an optional field used to determine the colour of the sidebar for the message. Valid values are good (green), warning (yellow), danger (red), or any hex value (e.g. '#abcdef'). Note that if you use a hex value, be sure to put it in quotes, otherwise the # will be interpreted as the start of a comment and the sidebar will come out an unattractive grey colour. If not specified, the default value is danger., (*12)

channel is the name of the channel to which exceptions are posted., (*13)

exclude_exception is an optional array of Exception class names which should be ignored. A typical use for this would be avoid a plethora of 'Not Found' exceptions being displayed for a production server that's publicly visible and thus subject to people randomly probing it., (*14)

The Versions

12/07 2018

dev-master

9999999-dev

Log symfony2 exceptions to a Slack channel

  Sources   Download

MIT

The Requires

 

exception slack

11/08 2017

2.0

2.0.0.0

Log symfony2 exceptions to a Slack channel

  Sources   Download

MIT

The Requires

 

exception slack

20/06 2015

1.0.2

1.0.2.0

Log symfony2 exceptions to a Slack channel

  Sources   Download

MIT

The Requires

 

exception slack

17/06 2015

1.0.1

1.0.1.0

Log symfony2 exceptions to a Slack channel

  Sources   Download

MIT

The Requires

 

exception slack

17/06 2015

1.0

1.0.0.0

Log symfony2 exceptions to a Slack channel

  Sources   Download

MIT

The Requires

 

exception slack