PHPackages                             vmorozov/laravel\_fluentd\_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. vmorozov/laravel\_fluentd\_logger

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

vmorozov/laravel\_fluentd\_logger
=================================

Provides ability to use fluentd as log driver.

v1.1.1(3y ago)111[2 PRs](https://github.com/freezer278/laravel_fluentd_logger/pulls)MITPHPPHP ^8.1

Since Dec 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/freezer278/laravel_fluentd_logger)[ Packagist](https://packagist.org/packages/vmorozov/laravel_fluentd_logger)[ Docs](https://github.com/:vendor_slug/:package_slug)[ RSS](/packages/vmorozov-laravel-fluentd-logger/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (12)Versions (6)Used By (0)

vmorozov/laravel\_fluentd\_logger
=================================

[](#vmorozovlaravel_fluentd_logger)

[![Latest Version on Packagist](https://camo.githubusercontent.com/d42bc435aa8619e3b51f43d68da7deb2412ca85343b637074f3a92ae6f222c91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f766d6f726f7a6f762f6c61726176656c5f666c75656e74645f6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vmorozov/laravel_fluentd_logger)[![Total Downloads](https://camo.githubusercontent.com/7ae8f3f2db1e6aa0a80e0a7545c5a536a95daf01519a803a1d4f261b80ab8616/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f766d6f726f7a6f762f6c61726176656c5f666c75656e74645f6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vmorozov/laravel_fluentd_logger)

This package provides ability to use fluentd as log driver. It also add additional logging capabilities such as:

- Request log
- DB Query log
- Queue Jobs log
- Log tracing

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

[](#installation)

You can install the package via composer:

```
composer require vmorozov/laravel_fluentd_logger
```

You can publish the config file with:

```
php artisan vendor:publish --tag="laravel_fluentd_logger-config"
```

Add middlewares to `app/Http/Kernel.php`:

```
protected $middleware = [
    // ... other middlewares here
    \Vmorozov\LaravelFluentdLogger\Middleware\LogRequestMiddleware::class,
    \Vmorozov\LaravelFluentdLogger\Middleware\ContinueTraceMiddleware::class,
];
```

Add fluentd log channel to `config/logging.php`:

```
// ...some exisiting channels

'fluentd' => [
    'driver' => 'fluentd',
    'level' => env('LOG_LEVEL', 'debug'),
],
```

Add ENV vars with fluentd configs:

```
FLUENTD_HOST=127.0.0.1
FLUENTD_PORT=24224
```

Configuration
-------------

[](#configuration)

In config file `laravel_fluentd_logger.php` you can make some adjustments:

- Disable some features

```
    'features_enabled' => [
        'request_log' => false,
        'db_query_log' => false,
        'queue_log' => false,
    ],
```

- Overwrite default fluentd log handler

```
    // optionally override \Vmorozov\LaravelFluentdLogger\Logs\FluentHandler class to customize behaviour
    'handler' => SomeCustomHandler::class,
```

- Change log tag format

```
'tagFormat' => '{{app_name}}.{{level_name}}',
```

- Overwrite some options for fluentd sdk classes

```
    /** @see https://github.com/fluent/fluent-logger-php/blob/master/src/FluentLogger.php */
    'options' => [],

    /** @see https://github.com/fluent/fluent-logger-php/blob/master/src/PackerInterface.php */
    // specified class name
    'packer' => null,
```

### Fluentd config samples

[](#fluentd-config-samples)

- simple stdout output:

```

  type stdout

```

- output to elasticsearch + stdout:

```
# sendlog to the elasticsearch
# the host must match to the elasticsearch
# container service

  @type copy

    @type elasticsearch
    host elasticsearch
    port 9200
    logstash_format true
    logstash_prefix fluentd
    logstash_dateformat %Y-%m-%d
    include_tag_key true
    type_name access_log
    tag_key @log_name
    flush_interval 1s
    log_es_400_reason false

    @type stdout

```

- config for fluentd to accept data using port:

```
# bind fluentd on IP 0.0.0.0
# port 24224

  @type forward
  port 24224
  bind 0.0.0.0

```

More info about fluentd configuration can be found in [official fluentd documentation](https://docs.fluentd.org/).

### Monolog processors

[](#monolog-processors)

You can add processors to the monolog handlers by adding them to the `processors` array within the `laravel_fluentd_logger.php` config. config/laravel\_fluentd\_logger.php:

```
'processors' => [CustomProcessor::class],
```

CustomProcessor.php:

```
class CustomProcessor
{
    public function __invoke($record)
    {
        $record['extra']['level'] = $record['level_name'];
        return $record;
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Credits
-------

[](#credits)

- [Vladimir Morozov](https://github.com/freezer278)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 76.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 ~3 days

Total

3

Last Release

1245d ago

### Community

Maintainers

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

---

Top Contributors

[![freezer278](https://avatars.githubusercontent.com/u/17979033?v=4)](https://github.com/freezer278 "freezer278 (26 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (4 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (4 commits)")

---

Tags

artisan-commands-logconsole-commands-logefk-stackelk-stackfluentdlaravelloggerlogginglogs-metadataphpquery-logqueue-jobs-logsrequest-logslaraveldebugginglogstracingadvanced loggingelk-stackrequest logfluentdEFK Stacklog tracingdb query log

###  Code Quality

TestsPHPUnit

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/vmorozov-laravel-fluentd-logger/health.svg)

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

###  Alternatives

[opcodesio/log-viewer

Fast and easy-to-use log viewer for your Laravel application

4.3k8.9M50](/packages/opcodesio-log-viewer)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[spatie/laravel-slack-alerts

Send a message to Slack

3212.6M4](/packages/spatie-laravel-slack-alerts)[spatie/laravel-error-share

Share your Laravel errors to Flare

43965.6k3](/packages/spatie-laravel-error-share)[tapp/filament-maillog

Filament plugin to view outgoing mail

2952.6k1](/packages/tapp-filament-maillog)[jacobtims/filament-logger

Activity logger for filament

1721.0k4](/packages/jacobtims-filament-logger)

PHPackages © 2026

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