renepardon / gelf-support by renepardon

A composer compliant package to support GELF logging within laravel/symfony projects
711
0
1
Package Data
Maintainer Username: renepardon
Maintainer Contact: rene.pardon@boonweb.de (Christoph, René Pardon)
Package Create Date: 2017-08-01
Package Last Update: 2017-11-06
Language: PHP
License: MIT
Last Refreshed: 2024-04-18 15:08:38
Package Statistics
Total Downloads: 711
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 0
Total Watchers: 1
Total Forks: 0
Total Open Issues: 0

GelfSupport

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.