PHPackages                             dulyanov/log4php-graylog2 - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Logging &amp; Monitoring](/categories/logging)
4. /
5. dulyanov/log4php-graylog2

ActiveLibrary[Logging &amp; Monitoring](/categories/logging)

dulyanov/log4php-graylog2
=========================

Log4php appenders and layouts for compatibility with graylog2

1.0.4(10y ago)1168.0k↓43.8%10[2 PRs](https://github.com/d-ulyanov/log4php-graylog2/pulls)Apache-2.0PHPPHP &gt;=5.2.7CI failing

Since Apr 20Pushed 6y ago2 watchersCompare

[ Source](https://github.com/d-ulyanov/log4php-graylog2)[ Packagist](https://packagist.org/packages/dulyanov/log4php-graylog2)[ Docs](https://github.com/d-ulyanov/log4php-graylog2)[ RSS](/packages/dulyanov-log4php-graylog2/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (7)Used By (0)

===== About
===========

[](#about)

Copyright (c) 2012-2016 Dmitriy Ulyanov

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.

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.

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

============ Installation
=========================

[](#installation)

---

For composer users

---

1. Add to your composer.json:

```
{
    "require": {
        "dulyanov/log4php-graylog2": "~1.0"
    },
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/d-ulyanov/log4php-graylog2.git"
        }
    ]
}
```

2. Run composer.phar update

---

For other users

---

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';
```

============= Configuration
===========================

[](#configuration)

---

XML

---

```

```

---

PHP

---

```
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'
            )
        ),
    ),
);
```

===== Usage
===========

[](#usage)

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

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

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity38

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 71.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~161 days

Total

5

Last Release

3765d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fbbc8455b5ec005d197abebb79d7a79776530621322b1fde591f7f8c8631baac?d=identicon)[d-ulyanov](/maintainers/d-ulyanov)

---

Top Contributors

[![d-ulyanov](https://avatars.githubusercontent.com/u/3064640?v=4)](https://github.com/d-ulyanov "d-ulyanov (5 commits)")[![alexshadow007](https://avatars.githubusercontent.com/u/647552?v=4)](https://github.com/alexshadow007 "alexshadow007 (1 commits)")[![Jackson88](https://avatars.githubusercontent.com/u/2025620?v=4)](https://github.com/Jackson88 "Jackson88 (1 commits)")

---

Tags

logphplogginggraylog2

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dulyanov-log4php-graylog2/health.svg)

```
[![Health](https://phpackages.com/badges/dulyanov-log4php-graylog2/health.svg)](https://phpackages.com/packages/dulyanov-log4php-graylog2)
```

###  Alternatives

[hedii/laravel-gelf-logger

A Laravel package to send logs to a gelf compatible backend like graylog

1333.4M10](/packages/hedii-laravel-gelf-logger)[logtail/monolog-logtail

Logtail handler for Monolog

233.2M3](/packages/logtail-monolog-logtail)[dastra/log4php-kafka

Kafka Appender for Log4Php

1017.0k](/packages/dastra-log4php-kafka)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
