2017 © Pedro Peláez
 

library log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

image

wikimart/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

  • Thursday, April 9, 2015
  • by KGBcheb
  • Repository
  • 5 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 9 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

=====, (*1)

About

Copyright (c) 2012-2014 Dmitriy Ulyanov, (*2)

Here you can find 2 new appenders for log4php: LoggerAppenderAMQP and LoggerAppenderGraylog2. You can pass log messages to Graylog2 or AMQP (RabbitMQ for ex.) using it., (*3)

Appender LoggerAppenderGraylog2 can pass messages directly to Graylog2 server. Appender LoggerAppenderAMQP can pass messages to AMQP Server. In this case you can set up yours graylog2 to recieving messages from AMQP., (*4)

If you would like to pass messages in GELF format, use special layout: LoggerLayoutGelf, (*5)

============, (*6)

Installation


For composer users, (*7)


  1. Add to your composer.json:br/
    {
        "require": {
            "wikimart/log4php-graylog2": ">=1.0.0"
        },
        "repositories": [
            {
                "type": "git",
                "url": "git://github.com/wikimart/log4php-graylog2.git"
            }
        ]
    }
  1. Run composer.phar update

For other users, (*8)


  1. Set up your log4php config file (see exampleConfig.xml)
  2. Use your new logger:

require 'log4php/Logger.php';
require 'log4php-graylog2/src/main/php/bootstrap.php';, (*9)

=============, (*10)

Configuration


XML, (*11)


        
            
                
                
                
                
                
                
                
                
                
            
            
                
                
                
            
            
                
                
                
            
        

PHP, (*12)


        array(
            'rootLogger' => array(
                'appenders' => array('MyAMQPAppender', 'MyGraylog2Appender')
            ),
            'appenders' => array(
                'MyAMQPAppender' => array(
                    'class' => 'LoggerAppenderAMQP',
                    'params' => array(
                        'host' => 'example.com',
                        'port' => 5672,
                        'vhost' => '/logs',
                        'login' => 'my_login',
                        'password' => 'my_secret_password',
                        'exchangeName' => 'my_exchange',
                        'routingKey' => 'php_application',
                        'contentType' => 'application/json'
                    ),
                    'layout' => array(
                        'class' => 'LoggerLayoutGelf'
                    )
                ),
                'MyGraylog2Appender' => array(
                    'class' => 'LoggerAppenderGraylog2',
                    'params' => array(
                        'host' => '192.168.1.123',
                        'port' => 12201
                    ),
                    'layout' => array(
                        'class' => 'LoggerLayoutGelf'
                    )
                ),
            ),
        );

=====, (*13)

Usage

Logger::configure('exampleConfig.xml', 'LoggerConfigurationAdapterXML');

$myLogger = Logger::getLogger('MyLogger');
$myLogger->debug("Hello world!");

The Versions

09/04 2015

dev-master

9999999-dev https://github.com/wikimart/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

  Sources   Download

Apache-2.0

The Requires

 

by Dmitry Ulyanov

log php logging log4php graylog2

09/04 2015

dev-develop

dev-develop https://github.com/wikimart/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

  Sources   Download

Apache-2.0

The Requires

 

by Dmitry Ulyanov

log php logging log4php graylog2

09/04 2015

1.0.3

1.0.3.0 https://github.com/wikimart/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

  Sources   Download

Apache-2.0

The Requires

 

by Dmitry Ulyanov

log php logging log4php graylog2

16/03 2015

1.0.2

1.0.2.0 https://github.com/wikimart/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

  Sources   Download

Apache-2.0

The Requires

 

by Dmitry Ulyanov

log php logging log4php graylog2

21/04 2014

1.0.1

1.0.1.0 https://github.com/d-ulyanov/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

  Sources   Download

Apache-2.0

The Requires

 

by Dmitry Ulyanov

log php logging graylog2

20/04 2014

1.0.0

1.0.0.0 https://github.com/d-ulyanov/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

  Sources   Download

Apache-2.0

The Requires

 

by Dmitry Ulyanov

log php logging graylog2