PHPackages                             coddin-web/laravel-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. coddin-web/laravel-gelf-logger

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

coddin-web/laravel-gelf-logger
==============================

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

7.1.0(4y ago)0905MITPHP ^8.0

Since Sep 9Pushed 3y agoCompare

[ Source](https://github.com/coddin-web/laravel-gelf-logger)[ Packagist](https://packagist.org/packages/coddin-web/laravel-gelf-logger)[ RSS](/packages/coddin-web-laravel-gelf-logger/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (35)Used By (0)

Laravel Gelf Logger
===================

[](#laravel-gelf-logger)

[![Build Status](https://github.com/hedii/laravel-gelf-logger/workflows/Tests/badge.svg)](https://github.com/hedii/laravel-gelf-logger/actions)[![Total Downloads](https://camo.githubusercontent.com/98a05779664981d601ca925928ec7811a9fb9d9eed8c531bffc08092d7cfaa99/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6c61726176656c2d67656c662d6c6f676765722f646f776e6c6f616473)](//packagist.org/packages/hedii/laravel-gelf-logger)[![License](https://camo.githubusercontent.com/a74e57f23c8fba308d5557144f6daeba1f8b792220132b34234a68cdd698563b/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6c61726176656c2d67656c662d6c6f676765722f6c6963656e7365)](//packagist.org/packages/hedii/laravel-gelf-logger)[![Latest Stable Version](https://camo.githubusercontent.com/2e1f12636e3df5158e815472496c9e472aa559bc4da50f1c92fc7107b7356710/68747470733a2f2f706f7365722e707567782e6f72672f68656469692f6c61726176656c2d67656c662d6c6f676765722f76)](//packagist.org/packages/hedii/laravel-gelf-logger)

**Laravel****laravel-gelf-logger**5.6^3.05.8^3.16.0^4.07.0^5.08.0^5.38.0^6.0 (with php 8)9.0^7.0A 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 Laravel wrapper for [bzikarsky/gelf-php](https://github.com/bzikarsky/gelf-php) package.

It uses the new [Laravel custom log channel](https://laravel.com/docs/master/logging) introduced in Laravel 5.6.

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 hedii/laravel-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' => \Hedii\LaravelGelfLogger\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' => [
                \Hedii\LaravelGelfLogger\Processors\NullStringProcessor::class,
                \Hedii\LaravelGelfLogger\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 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,
            ],

            // 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 Laravel logging configuration, you can use the gelf log channel [as any Laravel log channel](https://laravel.com/docs/master/logging#writing-log-messages).

### 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)

laravel-gelf-logger is released under the MIT Licence. See the bundled [LICENSE](https://github.com/hedii/laravel-gelf-logger/blob/master/LICENSE.md) file for details.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity80

Battle-tested with a long release history

 Bus Factor1

Top contributor holds 75.8% 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 ~68 days

Recently: every ~41 days

Total

32

Last Release

1412d ago

Major Versions

2.1.0 → 3.0.02018-12-27

3.3.0 → 4.0.02019-09-05

4.1.1 → 5.0.02020-03-03

5.3.0 → 6.0.02020-11-30

6.2.0 → 7.0.02022-02-09

PHP version history (6 changes)1.0.0PHP &gt;=7.0

2.0.0PHP ^7.1.3

5.0.0PHP ^7.2.5

6.0.0PHP ^7.3|^8.0

7.0.0PHP ^8.0

5.3.1PHP ^7.2.5|^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/51f79bc7bc85a6f14863b7dda6b9083db73244068711b575e46e5c8a3628b054?d=identicon)[falko100](/maintainers/falko100)

---

Top Contributors

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

---

Tags

logphplaravellogginghediigraylog2grayloggelfudplaravel-gelf

### Embed Badge

![Health badge](/badges/coddin-web-laravel-gelf-logger/health.svg)

```
[![Health](https://phpackages.com/badges/coddin-web-laravel-gelf-logger/health.svg)](https://phpackages.com/packages/coddin-web-laravel-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)[ytake/laravel-fluent-logger

fluent logger for laravel and lumen

63541.6k1](/packages/ytake-laravel-fluent-logger)[hedii/artisan-log-cleaner

An artisan command to clear laravel log files

4161.6k](/packages/hedii-artisan-log-cleaner)[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)
