2017 © Pedro Peláez
 

symfony-bundle graylog-bundle

Hello Graylog2 Bundle

image

hgtan/graylog-bundle

Hello Graylog2 Bundle

  • Thursday, July 23, 2015
  • by hoangthienan
  • Repository
  • 1 Watchers
  • 1 Stars
  • 238 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 1 Versions
  • 3 % Grown

The README.md

HelloGraylogBundle

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Build Status Coverage Status Quality Score HHVM Status, (*2)

SensioLabsInsight, (*3)

Connecting logging through Graylog2 to projects on Symfony2 and the following Library: * Graylog2 gelf-php, (*4)

Installation

Step 1: Using Composer

composer.json, (*5)

    php composer.phar require hgtan/graylog-bundle:dev-master

Step 2 : Register the bundle

Then register the bundle with your kernel:, (*6)

    <?php

    // in AppKernel::registerBundles()
    $bundles = array(
        // ...
        new Hgtan\Bundle\HelloGraylogBundle\HgtanHelloGraylogBundle(),
        // ...
    );

Step 3 : Configure the bundle

    # app/config/parameters.yml
    parameters:
        graylog_host: 172.16.4.105
        graylog_port: 12201

    # app/config/config.yml
    monolog:
        handlers:
            gelf:
                type: service
                id: monolog.gelf_handler
                level: debug    

Step 4 : Test

    $ php app/console server:run

    http://127.0.0.1:8000/hello/graylog

Example:, (*7)

    $logger = new Logger('Graylog2');

    $gelfHandler = $this->get('monolog.gelf_handler');
    $logger->pushHandler($gelfHandler);

    $logger->warning('Test warning message');
    $logger->error('Test error message');
    $logger->info('Test info message');
    $logger->debug('Test debug message');

    http://172.16.4.105:9000/

The Versions

23/07 2015

dev-master

9999999-dev http://hoangthienan.github.io

Hello Graylog2 Bundle

  Sources   Download

MIT