upnid/logentries-bundle

Push Symfony logs to Logentries.

This package's canonical repository appears to be gone and the package has been frozen as a result.

0.1.2 2016-02-12 04:12 UTC

This package is not auto-updated.

Last update: 2019-11-28 20:00:04 UTC


README

Push Symfony logs to Logentries.

Instructions

1 - Install the library

composer require upnid/logentries-bundle

2 - Add the bundle

<?php
# app/AppKernel.php

// ...
class AppKernel extends Kernel
{
    public function registerBundles()
    {
        $bundles = array(
            // ...

            new Upnid\Bundle\LogentriesBundle\LogentriesBundle(),
        );

        // ...
    }

    // ...
}

3 - Configure the bundle

# app/config/config.yml
logentries:
	token: YOUR_PROJECT_TOKEN_HERE

4 - And add the handler

# app/config/config.yml
monolog:
    handlers:
        logentries:
            type: service
            id: logentries.monolog.handler

Ready. It's enough.

Production Configurations

If you are using Logentries for production, what you probably are, you want to log only relevant things, like exceptions, errors, etc. For that, you can use some magic configurations.

Instead using the configurations shown in the forth step, use the following:

# app/config/config.yml
monolog:
    handlers:
        fc_logentries:
            type:         fingers_crossed
            action_level: error
            handler:      logentries
        logentries:
            type: service
            id: logentries.monolog.handler
            level: debug

@TODO

  • Make tests.

Licence

MIT. See here.