PHPackages                             enklare-development/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. [HTTP &amp; Networking](/categories/http)
4. /
5. enklare-development/laravel-gelf-logger

ActiveLibrary[HTTP &amp; Networking](/categories/http)

enklare-development/laravel-gelf-logger
=======================================

Fork of the hedii/laravel-gelf-logger project with extended support for HttpTransport

5.2.2(6y ago)01.6k1MITPHPPHP ^7.2

Since Sep 9Pushed 6y agoCompare

[ Source](https://github.com/Enklare-Development/laravel-gelf-logger)[ Packagist](https://packagist.org/packages/enklare-development/laravel-gelf-logger)[ Docs](https://www.enklare.se)[ RSS](/packages/enklare-development-laravel-gelf-logger/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (7)Dependencies (3)Versions (27)Used By (0)

Readme
======

[](#readme)

Fork of the hedii/laravel-gelf-logger project with support for HttpTransport.

Links to original project:
==========================

[](#links-to-original-project)

- Github:
- Packagist:

This projects packagist page
============================

[](#this-projects-packagist-page)

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

[](#laravel-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 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 or TCP 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 enklare-development/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,
                \Foo\Bar\AnotherProcessor::class,
            ],

            // 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 lets you control if you wish to send "level" and higher
            // to gelf, or only filter out "level" messages (ex: WARNING, ERROR, CRITICAL or only WARNING and not any other levels)
            'filtered_handler' => false,

            // 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 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 api endpoint path that receives
            // gelf log messages. Default is '/'
            'path' => '/',

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

            // 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,
        ],
    ],
];
```

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

### Examples

[](#examples)

```
// 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/enklare-development/laravel-gelf-logger/blob/master/LICENSE.md) file for details.

###  Health Score

33

—

LowBetter than 72% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 64.1% 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 ~55 days

Recently: every ~5 days

Total

26

Last Release

2239d ago

Major Versions

1.1.1 → 2.0.02018-10-09

2.1.0 → 3.0.02018-12-27

3.3.0 → 4.0.02019-09-05

4.1.1 → 5.0.02020-03-03

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

2.0.0PHP ^7.1.3

5.0.0PHP ^7.2.5

5.1.1PHP ^7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25532594?v=4)[Christian Nilsson](/maintainers/ChristianNilsson)[@christiannilsson](https://github.com/christiannilsson)

![](https://avatars.githubusercontent.com/u/3242799?v=4)[Pierre](/maintainers/pjaer)[@pjaer](https://github.com/pjaer)

---

Top Contributors

[![hedii](https://avatars.githubusercontent.com/u/5358048?v=4)](https://github.com/hedii "hedii (41 commits)")[![pierrevahlberg](https://avatars.githubusercontent.com/u/49915767?v=4)](https://github.com/pierrevahlberg "pierrevahlberg (9 commits)")[![rytisder](https://avatars.githubusercontent.com/u/17141616?v=4)](https://github.com/rytisder "rytisder (5 commits)")[![andrew-nuwber](https://avatars.githubusercontent.com/u/33055211?v=4)](https://github.com/andrew-nuwber "andrew-nuwber (3 commits)")[![StefanT123](https://avatars.githubusercontent.com/u/28436358?v=4)](https://github.com/StefanT123 "StefanT123 (2 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)")[![pjaer](https://avatars.githubusercontent.com/u/3242799?v=4)](https://github.com/pjaer "pjaer (1 commits)")[![qwert1x](https://avatars.githubusercontent.com/u/471334?v=4)](https://github.com/qwert1x "qwert1x (1 commits)")

---

Tags

httplaravelgrayloggelfenklare

### Embed Badge

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

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

###  Alternatives

[hedii/laravel-gelf-logger

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

1353.7M13](/packages/hedii-laravel-gelf-logger)[pusher/pusher-http-laravel

\[DEPRECATED\] A Pusher bridge for Laravel

404510.0k4](/packages/pusher-pusher-http-laravel)[vinelab/http

An http library developed for the laravel framework. aliases itself as HttpClient

57304.2k11](/packages/vinelab-http)[wendelladriel/laravel-idempotency

HTTP Idempotency Middleware for Laravel applications

1578.4k](/packages/wendelladriel-laravel-idempotency)[laravel-shift/curl-converter

A command line tool to convert curl requests to Laravel HTTP requests.

935.5k](/packages/laravel-shift-curl-converter)[chelout/laravel-http-logger

A Laravel package to log HTTP requests, headers and sessions

272.0k](/packages/chelout-laravel-http-logger)

PHPackages © 2026

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