twodudes/error-logger-bundle

Symfony2 production error logger. Logs notices, warnings, exceptions and fatal exceptions. Groups similar errors together and displays additional server information.

dev-master 2015-11-05 07:50 UTC

This package is not auto-updated.

Last update: 2024-05-11 14:32:11 UTC


README

Description

This bundle helps you to accumulate and browse errors in the production environment. Repetitive errors are grouped together.

Installation

  1. In your composer.json require section:

    "twodudes/error-logger-bundle": "dev-master"

  2. Run "composer update" and add in the bundles configuration array:


new TwoDudes\ErrorLoggerBundle\TwoDudesErrorLoggerBundle()

  1. In your routing.yml:

    two_dudes_errors:
        resource: "@TwoDudesErrorLoggerBundle/Resources/config/routing.yml"

  1. In your config.prod:

two_dudes:
  error_logger:
    storage:
      service: two_dudes.storage.db
      params:
        db_host: xxxxx
        db_port: xxxxx
        db_name: xxxxx
        db_user: xxxxx
        db_password: xxxxx

  1. Create a table to store errors:

php app/console twodudes:errorlogger:setup

Now you can access /_errors page, where everything will be displayed. Don't forget to protect it with a firewall. If you want to create your own storage - just implement StorageManagerInterface.

TIPS:

  1. How to work doctrine migrations.

doctrine:
    dbal:
        schema_filter: ~^(?!errors)~


  1. How to protect /_errors page in security.yml

security:

    encoders:
        Symfony\Component\Security\Core\User\User: plaintext


    providers:
        inmemory:
            memory:
                users:
                    admin: { password: adminpass }

    firewalls:
        errors:
            pattern:  ^/_errors
            http_basic:
                provider: inmemory

  1. Disable 404 errors logging (Which are 'no route found')

two_dudes:
  error_logger:
    log404: false