renepardon/gelf-support

A composer compliant package to support GELF logging within laravel/symfony projects

0.0.3 2017-11-06 11:11 UTC

This package is auto-updated.

Last update: 2024-10-17 20:35:11 UTC


README

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

A composer compliant package to support GELF logging within laravel/symfony projects

Structure

config/     Contains configuration files
src/        Contains the package source code
tests/      Contains PHPUnit tests
vendor/     Contains dependencies

We set the gelf-php facility so you can easily parse the INPUT of Graylog and pass it to your correct stream.

Install

Via Composer

$ composer require renepardon/gelf-support:"dev-master"

laravel

Add the following line to the config/app.php file within providers section:

\RenePardon\GelfSupport\GelfSupportServiceProvider::class,

Adjust the .env file to contain required constants which points to your Graylog2 server

GRAYLOG_ENABLED=true
GRAYLOG_HOST=localhost
GRAYLOG_PORT=12201

You can of course adjust the configuration file directly so publish it to your appication with the following command:

php artisan vendor:publish --provider="RenePardon\GelfSupport\GelfSupportServiceProvider" --tag="config"

symfony

Add the following block to your config.yml:

gelf:
    graylog:
        enabled: true
        host: localhost
        port: 12201
services:
    gelf_support_handler:
        class: RenePardon\GelfSupport\GelfBundle\MonologHandler
        arguments: [@service_container]

config_prod.yml and config_dev.yml should contain this block:

monolog:
    handlers:
        gelf:
            type: service
            id: gelf_support_handler

Register the GelfSupport bundle within app/AppKernel.php - add the next line to $bundles array:

new \RenePardon\GelfSupport\GelfBundle\GelfBundle(),

Change log

Please see CHANGELOG for more information on what has changed recently.

Testing

TO BE DONE - FEEL FREE TO WRITE SOME TESTS

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email rene.pardon@boonweb.de instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.