PHPackages                             nuwber/hypervel-gelf-logger - 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. nuwber/hypervel-gelf-logger

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

nuwber/hypervel-gelf-logger
===========================

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

v1.0.0(6mo ago)0318MITPHPPHP ^8.2CI passing

Since Oct 24Pushed 6mo agoCompare

[ Source](https://github.com/nuwber/hypervel-gelf-logger)[ Packagist](https://packagist.org/packages/nuwber/hypervel-gelf-logger)[ RSS](/packages/nuwber-hypervel-gelf-logger/feed)WikiDiscussions master Synced 1mo ago

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

Hypervel Gelf Logger
====================

[](#hypervel-gelf-logger)

A package to send [gelf](http://docs.graylog.org/en/2.1/pages/gelf.html) logs to a gelf compatible backend like graylog. It is a Hypervel wrapper for [bzikarsky/gelf-php](https://github.com/bzikarsky/gelf-php) package.

This package uses Hypervel's custom log channel system.

A gelf receiver like graylog2 must be configured to receive messages with a GELF UDP, TCP or HTTP Input.

Table of contents
-----------------

[](#table-of-contents)

- [Table of contents](#table-of-contents)
- [Installation](#installation)
- [Usage](#usage)
    - [Example](#example)
- [Testing](#testing)
- [License](#license)

Installation
------------

[](#installation)

Install via [composer](https://getcomposer.org/doc/00-intro.md)

```
composer require nuwber/hypervel-gelf-logger
```

Edit `config/logging.php` to add the new `gelf` log channel.

```
return [
    'default' => env('LOG_CHANNEL', 'stack'),

    'channels' => [
        // You can use the gelf log channel with the stack log channel
        'stack' => [
            'driver' => 'stack',
            'channels' => ['daily', 'gelf'],
        ],

        // other log channels...

        'gelf' => [
            'driver' => 'custom',

            'via' => \Nuwber\HypervelGelfLogger\GelfLoggerFactory::class,

            // This optional option determines the processors that should be
            // pushed to the handler. This option is useful to modify a field
            // in the log context (see NullStringProcessor), or to add extra
            // data. Each processor must be a callable or an object with an
            // __invoke method: see monolog documentation about processors.
            // Default is an empty array.
            'processors' => [
                \Nuwber\HypervelGelfLogger\Processors\NullStringProcessor::class,
                \Nuwber\HypervelGelfLogger\Processors\RenameIdFieldProcessor::class,
                // another processor...
            ],

            // This optional option determines the minimum "level" a message
            // must be in order to be logged by the channel. Default is 'debug'
            'level' => 'debug',

            // This optional option determines the channel name sent with the
            // message in the 'facility' field. Default is equal to app.env
            // configuration value
            'name' => 'my-custom-name',

            // This optional option determines the system name sent with the
            // message in the 'source' field. When forgotten or set to null,
            // the current hostname is used.
            'system_name' => null,

            // This optional option determines if you want the UDP, TCP or HTTP
            // transport for the gelf log messages. Default is UDP
            'transport' => 'udp',

            // This optional option determines the host that will receive the
            // gelf log messages. Default is 127.0.0.1
            'host' => '127.0.0.1',

            // This optional option determines the port on which the gelf
            // receiver host is listening. Default is 12201
            'port' => 12201,

            // This optional option determines the chunk size used when
            // transferring message via UDP transport. Default is 1420.
            'chunk_size' => 1420,

            // This optional option determines the path used for the HTTP
            // transport. When forgotten or set to null, default path '/gelf'
            // is used.
            'path' => null,

            // This optional option enable or disable ssl on TCP or HTTP
            // transports. Default is false.
            'ssl' => false,

            // If ssl is enabled, the following configuration is used.
            'ssl_options' => [
                // Enable or disable the peer certificate check. Default is
                // true.
                'verify_peer' => true,

                // Path to a custom CA file (eg: "/path/to/ca.pem"). Default
                // is null.
                'ca_file' => null,

                // List of ciphers the SSL layer may use, formatted as
                // specified in ciphers(1). Default is null.
                'ciphers' => null,

                // Whether self-signed certificates are allowed. Default is
                // false.
                'allow_self_signed' => false,
            ],

            // If you want to send messages to the gelf server using http basic
            // authentication, the following configuration is used. Only useful
            // if transport is set to http.
            'http_basic_auth' => [
                // The http basic authentication username.
                'username' => null,

                // The http basic authentication password.
                'password' => null,
            ],

            // This optional option determines the maximum length per message
            // field. When forgotten or set to null, the default value of
            // \Monolog\Formatter\GelfMessageFormatter::DEFAULT_MAX_LENGTH is
            // used (currently this value is 32766)
            'max_length' => null,

            // This optional option determines the prefix for 'context' fields
            // from the Monolog record. Default is null (no context prefix)
            'context_prefix' => null,

            // This optional option determines the prefix for 'extra' fields
            // from the Monolog record. Default is null (no extra prefix)
            'extra_prefix' => null,

            // This optional option determines whether errors thrown during
            // logging should be ignored or not. Default is true.
            'ignore_error' => true,

        ],
    ],
];
```

Usage
-----

[](#usage)

Once you have modified the Hypervel logging configuration, you can use the gelf log channel as any Hypervel log channel.

### Example

[](#example)

```
// Explicitly use the gelf channel
Log::channel('gelf')->debug($message, ['foo' => 'bar']);
Log::channel('gelf')->emergency($message, ['foo' => 'bar']);

// In case of a stack log channel containing the gelf log channel and stack
// configured as the default log channel
Log::notice($message, ['foo' => 'bar']);

// Using the logger helper
logger($message, $context);
```

Testing
-------

[](#testing)

```
composer test

```

License
-------

[](#license)

hypervel-gelf-logger is released under the MIT Licence. See the bundled LICENSE file for details.

Credits
-------

[](#credits)

This package is a Hypervel port of [hedii/laravel-gelf-logger](https://github.com/hedii/laravel-gelf-logger).

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance66

Regular maintenance activity

Popularity16

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.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

Unknown

Total

1

Last Release

207d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/e4637db0cda55fbb06d44595f2261146ddf20943bed50c29f784d790b4ed0f4d?d=identicon)[masterjus](/maintainers/masterjus)

![](https://avatars.githubusercontent.com/u/33055211?v=4)[Andrew](/maintainers/andrew-nuwber)[@andrew-nuwber](https://github.com/andrew-nuwber)

---

Top Contributors

[![hedii](https://avatars.githubusercontent.com/u/5358048?v=4)](https://github.com/hedii "hedii (91 commits)")[![andrew-nuwber](https://avatars.githubusercontent.com/u/33055211?v=4)](https://github.com/andrew-nuwber "andrew-nuwber (10 commits)")[![arnidan](https://avatars.githubusercontent.com/u/5755685?v=4)](https://github.com/arnidan "arnidan (6 commits)")[![rytisder](https://avatars.githubusercontent.com/u/17141616?v=4)](https://github.com/rytisder "rytisder (6 commits)")[![patriziotomato](https://avatars.githubusercontent.com/u/544502?v=4)](https://github.com/patriziotomato "patriziotomato (3 commits)")[![jesperbeisner](https://avatars.githubusercontent.com/u/50325931?v=4)](https://github.com/jesperbeisner "jesperbeisner (2 commits)")[![StefanT123](https://avatars.githubusercontent.com/u/28436358?v=4)](https://github.com/StefanT123 "StefanT123 (2 commits)")[![qwert1x](https://avatars.githubusercontent.com/u/471334?v=4)](https://github.com/qwert1x "qwert1x (1 commits)")[![berkaygure](https://avatars.githubusercontent.com/u/5683957?v=4)](https://github.com/berkaygure "berkaygure (1 commits)")[![yaapis](https://avatars.githubusercontent.com/u/390195?v=4)](https://github.com/yaapis "yaapis (1 commits)")[![chococrypto](https://avatars.githubusercontent.com/u/27860198?v=4)](https://github.com/chococrypto "chococrypto (1 commits)")

---

Tags

gelfgrayloghyperfhypervelphplogphplogginggraylog2grayloggelfudphypervelnuwberhypervel-gelf

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/nuwber-hypervel-gelf-logger/health.svg)

```
[![Health](https://phpackages.com/badges/nuwber-hypervel-gelf-logger/health.svg)](https://phpackages.com/packages/nuwber-hypervel-gelf-logger)
```

###  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)[analog/analog

Fast, flexible, easy PSR-3-compatible PHP logging package with dozens of handlers.

3451.5M24](/packages/analog-analog)[dulyanov/log4php-graylog2

Log4php appenders and layouts for compatibility with graylog2

1168.0k](/packages/dulyanov-log4php-graylog2)

PHPackages © 2026

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