Code Monkey home page Code Monkey logo

propelloggerbundle's Introduction

Propel Logger Bundle

This logger show you full queries stacktraces and duplicate queries.
For each stacktrace you can see the inner class/file code.

Prerequisites

This version of the bundle requires Symfony => 2.2.x. If you use Symfony 2.1.x, please switch to the branch 2.1.
If you use PHP 5.3, please switch on the php5.3 branch.

Installation

Step 1: Download PropelLoggerBundle using composer

In your composer.json, add PropelLoggerBundle (only for dev) :

{
    "require-dev": {
        "divi/propel-logger-bundle": "2.2.*@dev"
    }
}

Now, you must update your vendors using this command :

$ php composer.phar update divi/propel-logger-bundle

Step 2: Enable the bundle

Enable the bundle using the AppKernel :

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Divi\PropelLoggerBundle\DiviPropelLoggerBundle(),
    );
}

Step 3: Configure your project

Configure the logger, you must provide your application namespace (only the organisation, like "Acme"). You can provide an array, and/or regex. Warning: if you provide a fully namespace, like "Foo\Bar", please double the backslash : it's a regex.

# app/config/config.yml
divi_propel_logger:
    namespaces: ["Acme", "Foo\\Bar"]

How to use

Now, in the Symfony web debug toolbar, you'll have a red circle if you have a duplicate query. If you want to see the stacktrace, open the Propel profiler, and click on "Explain the query" on the selected query.

Test instance

You can have memory leak issue in test instance (unit tests) due to the stacktrace saving process.
If an issue appears, just load the bundle only for dev instance in your AppKernel, move the bundle configuration to config_dev.yml and in the config_test.yml, do not import the config_dev.yml file but config.yml. Finally, copy and paste the monolog configuration section from the dev config to your test config file.

Issue or new feature ?

Feel free to post your issue or feature request in the issue tracker !

propelloggerbundle's People

Contributors

divi avatar tseho avatar

Stargazers

 avatar Jérémie Augustin avatar  avatar

Watchers

James Cloos avatar  avatar Eymeric Taelman avatar

Forkers

tseho

propelloggerbundle's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.