Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/renepardon/gelf-support

Composer package to support GELF logging with laravel/symfony projects
https://github.com/renepardon/gelf-support

Last synced: about 1 month ago
JSON representation

Composer package to support GELF logging with laravel/symfony projects

Awesome Lists containing this project

README

        

# GelfSupport

[![Latest Version on Packagist][ico-version]][link-packagist]
[![Software License][ico-license]](LICENSE.md)
[![Build Status][ico-travis]][link-travis]
[![Coverage Status][ico-scrutinizer]][link-scrutinizer]
[![Quality Score][ico-code-quality]][link-code-quality]
[![Total Downloads][ico-downloads]][link-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

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

### laravel

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

``` php
\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:

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

### symfony

Add the following block to your **config.yml**:

``` yaml
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:

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

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

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

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Testing

TO BE DONE - FEEL FREE TO WRITE SOME TESTS

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

## Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Credits

- [Christoph, René Pardon][link-author]
- [All Contributors][link-contributors]

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

[ico-version]: https://img.shields.io/packagist/v/renepardon/gelf-support.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square
[ico-travis]: https://img.shields.io/travis/renepardon/gelf-support/master.svg?style=flat-square
[ico-scrutinizer]: https://img.shields.io/scrutinizer/coverage/g/renepardon/gelf-support.svg?style=flat-square
[ico-code-quality]: https://img.shields.io/scrutinizer/g/renepardon/gelf-support.svg?style=flat-square
[ico-downloads]: https://img.shields.io/packagist/dt/renepardon/gelf-support.svg?style=flat-square

[link-packagist]: https://packagist.org/packages/renepardon/gelf-support
[link-travis]: https://travis-ci.org/renepardon/gelf-support
[link-scrutinizer]: https://scrutinizer-ci.com/g/renepardon/gelf-support/code-structure
[link-code-quality]: https://scrutinizer-ci.com/g/renepardon/gelf-support
[link-downloads]: https://packagist.org/packages/renepardon/gelf-support
[link-author]: https://github.com/renepardon
[link-contributors]: ../../contributors