uga/php4logger-bundle

php4logger log your object with symfony2

Installs: 271 972

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 0

Open Issues: 0

Type:symfony-bundle

1.0 2017-02-27 21:30 UTC

This package is auto-updated.

Last update: 2024-03-23 02:33:26 UTC


README

log4php.png?raw=true

Bundle for logger Object for Symfony2 ```shell ____ _ _ _ _ __ | _ \| |__ _ __ | || | | | ___ __ _ __ _ ___ _ __ / _| ___ _ __ | |_) | '_ \| '_ \| || |_| | / _ \ / _` |/ _` |/ _ \ '__| | |_ / _ \| '__| | __/| | | | |_) |__ _| |__| (_) | (_| | (_| | __/ | | _| (_) | | |_| |_| |_| .__/ |_| |_____\___/ \__, |\__, |\___|_| |_| \___/|_| |_| |___/ |___/ ____ __ _ / ___| _ _ _ __ ___ / _| ___ _ __ _ _ | |__ _ _ \___ \| | | | '_ ` _ \| |_ / _ \| '_ \| | | | | '_ \| | | | ___) | |_| | | | | | | _| (_) | | | | |_| | | |_) | |_| | |____/ \__, |_| |_| |_|_| \___/|_| |_|\__, | |_.__/ \__, | |___/ |___/ |___/ ____ _ _____ ____ | _ \| | __ _ _ __ __|_ _| _ \ _____ __ | |_) | |/ _` | '_ \ / _ \| | | | | |/ _ \ \ / / | __/| | (_| | | | | __/| | | |_| | __/\ V / |_| |_|\__,_|_| |_|\___||_| |____/ \___| \_/ ```

How to install ?

Just add this bundle with :

composer require uga/php4logger-bundle

Enable it in the Kernel

new uga\Php4LoggerApacheBundle\ugaPhp4LoggerApacheBundle(),

How to make it ?

In your controller:

        $em = $this->getDoctrine()->getEntityManager() ;  // Object 
        $logger = $this->container->get('uga_php4_logger_apache')->getLogger() ; 
        $logger->info($em); // info
        $logger->error($em); // error
        $logger->warn($em); // warning
        }

Result with color in terminal

tail -f /tmp/error.log |
sed -e 's/\(.*INFO.*\)/\o033[36m\0/' \
    -e 's/\(.*ERROR.*\)/\o033[31m\0/' \
    -e 's/\(.*WARN.*\)/\o033[33m\0/'

Demo

demo.png?raw=true

Information:

Contact Me

Nadir Fouka < nadir@fouka.ovh >

  • Web Developer Grenoble Alpes University 2017
  • Data Scientist Planet@Dev