brigthside / monolog-fluentd-bundle
Symfony2 bundle defining a fluentd handler for monolog
This package's canonical repository appears to be gone and the package has been frozen as a result.
Installs: 1 482
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 5
Open Issues: 0
Type:symfony-bundle
Requires
- php: ^5.5 || >=7.0 <7.4
- fluent/logger: ^1.0
- symfony/monolog-bundle: ^2.12 || ^3.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.2
- phpunit/phpunit: ^4.8 || ^5.4
- sensiolabs/security-checker: ^4.0
- symfony/debug: ^2.0 || ^3.0
- symfony/var-dumper: ^2.0 || ^3.0
README
musement/monolog-fluentd-bundle
This Symfony bundle enables logging to fluentd via monolog.
Fluentd is an open source data collector, it decouples data sources from backend systems by providing a unified logging layer in between.
Install
composer require musement/monolog-fluentd-bundle
Register the bundle in Symfony
<?php
// AppKernel.php
use Symfony\Component\HttpKernel\Kernel;
use Symfony\Component\Config\Loader\LoaderInterface;
class AppKernel extends Kernel
{
public function registerBundles()
{
$bundles = array(
...
new Musement\MonologFluentdBundle\MusementMonologFluentdBundle(),
);
...
}
}
You can avoid loading the bundle (i.e. include it only in staging/prod environment) by means of something such as the following:
$bundles = array(
...
);
if (in_array($this->getEnvironment(), array('production', 'staging'))) {
$bundles[] = new Musement\MonologFluentdBundle\MusementMonologFluentdBundle();
}
Configuration
These are the default parameters:
musement_monolog_fluentd:
host: localhost
port: 24224
options: []
level: debug
tag_fmt: '{{channel}}.{{level_name}}'
exceptions: true
You can modify them in config.yml or parameters.yml
You may load the handler as a service
monolog:
handlers:
musement_monolog_fluentd:
type: service
id: musement_monolog_fluentd.fluentd_handler
How to run the tests
phpunit -c phpunit.xml.dist
Copyright
© Musement S.p.A.