PHPackages                             xakki/fluent-log - 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. xakki/fluent-log

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

xakki/fluent-log
================

Docker Fluent log configs

0.1.4(1mo ago)027GPL-3.0-or-laterLua

Since Jun 7Pushed 1mo agoCompare

[ Source](https://github.com/Xakki/FluentLog)[ Packagist](https://packagist.org/packages/xakki/fluent-log)[ RSS](/packages/xakki-fluent-log/feed)WikiDiscussions main Synced 1w ago

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

fluent-log
==========

[](#fluent-log)

Drop-in [fluent-bit](https://fluentbit.io/) configuration that ships Docker container logs and on-disk log files to [Graylog](https://www.graylog.org/) over GELF, and exposes fluent-bit's own metrics to Prometheus.

It normalizes heterogeneous sources (PHP/Monolog JSON, nginx, MariaDB, Redis/KeyDB, raw stderr) into a consistent GELF record: a Monolog-style level, a correct event timestamp, and GELF-safe flat fields.

Integration
-----------

[](#integration)

This is a **config bundle**, not application code. You consume it by `include:`-ing its `docker-fluent.yml` into your Compose stack and adding a thin overlay (an `x-logging` anchor

- per-service labels). The `fluent-bit`/`logrotate` services, their volumes and the config bind-mounts (`./fluent-bit`, `./logrotate`, `./service.d`) all come from the include — **configs are used verbatim, never copied into your repo**. Update = bump the pinned version.

Compose resolves relative paths *inside* `docker-fluent.yml` relative to its own directory, so they point into the vendored copy; the `include:` path itself is relative to your project root (cwd where compose runs). Requires Docker Compose ≥ 2.20.

Vendor the bundle one of two ways:

### A) Composer (PHP projects)

[](#a-composer-php-projects)

```
composer require xakki/fluent-log
```

Lands at `vendor/xakki/fluent-log/`. In your logging overlay:

```
include:
    - vendor/xakki/fluent-log/docker-fluent.yml
```

Companion PHP loggers that emit the structured logs this config expects:

- Laravel / Monolog — [Xakki/LaraLog](https://github.com/Xakki/LaraLog)
- Plain PHP (PSR only) — [Xakki/PHPErrorCatcher](https://github.com/Xakki/PHPErrorCatcher)

### B) git submodule (any stack — Python, Go, Node, …)

[](#b-git-submodule-any-stack--python-go-node-)

For projects without Composer. Pin a release tag:

```
git submodule add https://github.com/Xakki/FluentLog.git infra/fluent-log
git -C infra/fluent-log checkout v0.1.3
```

```
include:
    - infra/fluent-log/docker-fluent.yml
```

A fresh clone must hydrate the submodule (the include path is empty otherwise and compose fails): `git clone --recurse-submodules`, or `git submodule update --init --recursive`. In GitLab/GitHub CI set `GIT_SUBMODULE_STRATEGY: recursive`. Bump = `git -C infra/fluent-log checkout ` then commit the submodule pointer.

### The overlay (both cases)

[](#the-overlay-both-cases)

Keep **only** the anchor + per-service labels in your file:

```
include:
    - infra/fluent-log/docker-fluent.yml          # or vendor/xakki/fluent-log/...

x-logging: &_logging
    logging:
        driver: fluentd
        options:
            fluentd-address: "${EXT_FLUENT_PORT:-127.0.0.1:24224}"
            fluentd-async: "true"
            tag: "service.{{.Name}}"
            # Forwarded as flat docker_* + log_format. Do NOT use env: — host/hostname/
            # docker_profile are set globally from fluent-bit's own env (see Configuration).
            labels: "com.docker.compose.service,com.docker.compose.project,com.docker.compose.image,tier,log_format"

services:
    app:
        /dev/null | awk '{print $$1}' || echo unknown)
```

If `JSON_LOG_PATH` / `MYSQL_SLOWLOG_PATH` are unset, empty named volumes are mounted so the stack still starts.

Log rotation
------------

[](#log-rotation)

`logrotate/logrotate.conf` rotates `*.log` (mysql) and `*.ndjson` (json) with `copytruncate` — mandatory because fluent-bit holds the file inode open on tail; a rename would detach it. Edit the config, then restart the `logrotate` container (it copies the config to a root-owned path at startup).

Ports
-----

[](#ports)

PortPurpose`24224`fluentd `forward` input (TCP/UDP)`2020`HTTP server — health / metrics`2021`Prometheus exporter (internal; proxied by nginx)

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance93

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity27

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~3 days

Total

4

Last Release

36d ago

### Community

Maintainers

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

---

Top Contributors

[![Xakki](https://avatars.githubusercontent.com/u/426468?v=4)](https://github.com/Xakki "Xakki (4 commits)")

### Embed Badge

![Health badge](/badges/xakki-fluent-log/health.svg)

```
[![Health](https://phpackages.com/badges/xakki-fluent-log/health.svg)](https://phpackages.com/packages/xakki-fluent-log)
```

###  Alternatives

[sentry/sentry

PHP SDK for Sentry (http://sentry.io)

1.9k247.1M346](/packages/sentry-sentry)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k38.9k](/packages/matomo-matomo)[illuminate/log

The Illuminate Log package.

6225.3M647](/packages/illuminate-log)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k16](/packages/tempest-framework)[api-platform/metadata

API Resource-oriented metadata attributes and factories

295.0M223](/packages/api-platform-metadata)[pagemachine/typo3-formlog

Form log for TYPO3

23238.6k8](/packages/pagemachine-typo3-formlog)

PHPackages © 2026

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