PHPackages                             keboola/gelf-server - 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. keboola/gelf-server

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

keboola/gelf-server
===================

Simple PHP server for GELF logger

4.0.0(3y ago)023.5k↓43.3%MITPHPPHP ^8.1

Since May 27Pushed 3y ago15 watchersCompare

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

READMEChangelog (8)Dependencies (11)Versions (14)Used By (0)

GELF server [![GitHub Actions](https://github.com/keboola/gelf-server/actions/workflows/push.yml/badge.svg)](https://github.com/keboola/gelf-server/actions/workflows/push.yml)
===============================================================================================================================================================================

[](#gelf-server-)

A php implementation of a [gelf](http://docs.graylog.org/en/2.0/pages/gelf.html) compatible backend like [Graylog2](https://www.graylog.org/). This library provides a simple server to which a GELF client can connect.

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

[](#installation)

Recommended installation via composer:

Add gelf-server to composer.json either by running `composer require keboola/gelf-server` or by defining it manually:

```
"require": {
   // ...
   "keboola/gelf-server": "^1.1"
   // ...
}

```

Reinstall dependencies: `composer install`

Usage
-----

[](#usage)

To create a server, use the `ServerFactory` class:

```
$server = ServerFactory::createServer(ServerFactory::SERVER_TCP);

```

To start listening for connections, us the `start` method. This method has the following parameters:

- `$minPort` and `$maxPort` - to set port on which the server listens. To listen on a single port use the same value for both `$minPort` and `$maxPort`. Otherwise the server will randomly choose a free port in the specified range (inclusive).
- `$onStart` - Callback executed when the server successfully started listening, the callback signature is `function ($port)`, which gives you the actual port the server is listening on.
- `$onProcess` - Callback executed periodically when the server is running. The callback has signature `function (&$terminated)`. The server will keep running indefinitely until you set `$terminated` to true in this callback.
- `$onEvent` - Callback executed when a GELF event is received. The callback has signature `function ($event)`. The `$event` variable contains associative array with [GELF fields](http://docs.graylog.org/en/2.0/pages/gelf.html#gelf-format-specification)
- `$onTerminate` - Optional callback executed when the server terminates - after it stops listening for connections. The callback signature is `function ()`.

Examples
--------

[](#examples)

For usage examples, see the [/examples](https://github.com/keboola/gelf-server/tree/master/examples) directory.

License
-------

[](#license)

MIT licensed, see [LICENSE](./LICENSE) file.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor1

Top contributor holds 93.5% 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 ~203 days

Recently: every ~74 days

Total

13

Last Release

1201d ago

Major Versions

1.2.1 → 2.0.02018-08-07

2.0.1 → 3.0.02022-04-11

3.0.3 → 4.0.02023-02-02

PHP version history (3 changes)3.0.0PHP ^7.4

3.0.3PHP ^7.4|^8.0

4.0.0PHP ^8.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/101dbf2551a0709ddab522f97669f13a2c4cc2d0a1e8d009f3af6ba80accb1a9?d=identicon)[Keboola](/maintainers/Keboola)

---

Top Contributors

[![odinuv](https://avatars.githubusercontent.com/u/4319320?v=4)](https://github.com/odinuv "odinuv (58 commits)")[![pepamartinec](https://avatars.githubusercontent.com/u/271753?v=4)](https://github.com/pepamartinec "pepamartinec (3 commits)")[![ujovlado](https://avatars.githubusercontent.com/u/419849?v=4)](https://github.com/ujovlado "ujovlado (1 commits)")

---

Tags

gelfgelf-servergraylog2php

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/keboola-gelf-server/health.svg)

```
[![Health](https://phpackages.com/badges/keboola-gelf-server/health.svg)](https://phpackages.com/packages/keboola-gelf-server)
```

###  Alternatives

[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/flare-client-php

Send PHP errors to Flare

177148.0M15](/packages/spatie-flare-client-php)[hedii/laravel-gelf-logger

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

1333.4M10](/packages/hedii-laravel-gelf-logger)[spatie/laravel-server-monitor

Monitor servers

844280.4k6](/packages/spatie-laravel-server-monitor)

PHPackages © 2026

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