PHPackages                             crhg/laravel-fluent-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. crhg/laravel-fluent-logger

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

crhg/laravel-fluent-logger
==========================

fluent logger for laravel and lumen

5.1.1(2y ago)0123MITPHPPHP ^7.3|^8.0.2

Since May 29Pushed 2y agoCompare

[ Source](https://github.com/crhg/Laravel-FluentLogger)[ Packagist](https://packagist.org/packages/crhg/laravel-fluent-logger)[ RSS](/packages/crhg-laravel-fluent-logger/feed)WikiDiscussions main Synced 1mo ago

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

laravel-fluent-logger
=====================

[](#laravel-fluent-logger)

fluent logger for laravel (with Monolog handler for Fluentd )

[fluentd](http://www.fluentd.org/)

[![Tests](https://github.com/ytake/Laravel-FluentLogger/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/ytake/Laravel-FluentLogger/actions/workflows/php.yml)[![Coverage Status](https://camo.githubusercontent.com/3167c102190cb89344755d90dfe55ab6af8480fa19091b5722df5a5c68af63b0/687474703a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f7974616b652f4c61726176656c2d466c75656e744c6f676765722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/ytake/Laravel-FluentLogger?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/cfc19ea3c0c53599113bdca878cefd648e76d54f3b1e073ec5ba5e77911b2996/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7974616b652f4c61726176656c2d466c75656e744c6f676765722e7376673f7374796c653d666c6174)](https://scrutinizer-ci.com/g/ytake/Laravel-FluentLogger/?branch=master)

[![License](https://camo.githubusercontent.com/cf077cf45445396bf0fbd45db8af64a97cad48b03a5755188580657fd06b90e8/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7974616b652f6c61726176656c2d666c75656e742d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ytake/laravel-fluent-logger)[![Latest Version](https://camo.githubusercontent.com/a38cfb200343df5211d8e03c22c57f8e5a9f48115886a75bd2ffafd34aab37d9/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7974616b652f6c61726176656c2d666c75656e742d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ytake/laravel-fluent-logger)[![Total Downloads](https://camo.githubusercontent.com/eeae8a0df9356845315492a55d79d9151f17caed9371c0120dbd39e6826ffc78/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7974616b652f6c61726176656c2d666c75656e742d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ytake/laravel-fluent-logger)

Versions
--------

[](#versions)

FrameworkLibraryLaravel / Lumen &lt; v10ytake/laravel-fluent-logger: ^5Laravel / Lumen v10ytake/laravel-fluent-logger: ^6usage
-----

[](#usage)

### Installation For Laravel

[](#installation-for-laravel)

Require this package with Composer

```
$ composer require ytake/laravel-fluent-logger
```

or composer.json

```
"require": {
  "ytake/laravel-fluent-logger": "^6.0"
},
```

**Supported Auto-Discovery(^Laravel5.5)**

for laravel
-----------

[](#for-laravel)

your config/app.php

```
'providers' => [
    \Ytake\LaravelFluent\LogServiceProvider::class,
]
```

### publish configure

[](#publish-configure)

- basic

```
$ php artisan vendor:publish
```

- use tag option

```
$ php artisan vendor:publish --tag=log
```

- use provider

```
$ php artisan vendor:publish --provider="Ytake\LaravelFluent\LogServiceProvider"
```

for Lumen
---------

[](#for-lumen)

use `Ytake\LaravelFluent\LumenLogServiceProvider`

bootstrap/app.php

```
$app->register(\Ytake\LaravelFluent\LumenLogServiceProvider::class);
```

Lumen will use your copy of the configuration file if you copy and paste one of the files into a config directory within your project root.

```
cp vendor/ytake/laravel-fluent-logger/src/config/fluent.php config/
```

### Config

[](#config)

edit config/fluent.php

```
return [

    'host' => env('FLUENTD_HOST', '127.0.0.1'),

    'port' => env('FLUENTD_PORT', 24224),

    /** @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,

    // optionally override Ytake\LaravelFluent\FluentHandler class to customize behaviour
    'handler' => null,

    'processors' => [],

    'tagFormat' => '{{channel}}.{{level_name}}',
];
```

added config/logging.php

```
return [
    'channels' => [
        'stack' => [
            'driver' => 'stack',
            // always added fluentd log handler
            // 'channels' => ['single', 'fluent'],
            // fluentd only
            'channels' => ['fluent'],
        ],

        'fluent' => [
            'driver' => 'fluent',
            'level' => 'debug',
        ],

        'single' => [
            'driver' => 'single',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
        ],

        'daily' => [
            'driver' => 'daily',
            'path' => storage_path('logs/laravel.log'),
            'level' => 'debug',
            'days' => 7,
        ],

        'slack' => [
            'driver' => 'slack',
            'url' => env('LOG_SLACK_WEBHOOK_URL'),
            'username' => 'Laravel Log',
            'emoji' => ':boom:',
            'level' => 'critical',
        ],

        'syslog' => [
            'driver' => 'syslog',
            'level' => 'debug',
        ],

        'errorlog' => [
            'driver' => 'errorlog',
            'level' => 'debug',
        ],
    ],
];
```

or custom / use `via`

```
return [
    'channels' => [
        'custom' => [
            'driver' => 'custom',
            'via' => \Ytake\LaravelFluent\FluentLogManager::class,
        ],
    ]
];
```

fluentd config sample
---------------------

[](#fluentd-config-sample)

```
## match tag=local.** (for laravel log develop)

  type stdout

```

example (production)

```

 type stdout

```

and more

for lumen
---------

[](#for-lumen-1)

fluentd config sample(lumen)
----------------------------

[](#fluentd-config-samplelumen)

```

  type stdout

```

Tag format
----------

[](#tag-format)

The tag format can be configured to take variables from the [LogEntry](https://github.com/Seldaek/monolog/blob/main/src/Monolog/LogRecord.php)object. This will then be used to match tags in fluent.

`{{channel}}` will be [Laravel's current environment](https://laravel.com/docs/10.x/logging#configuring-the-channel-name) as configured in `APP_ENV`, NOT the logging channel from `config/logging.php`

`{{level_name}}` will be the [uppercase string version of the log level](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Level.php#L136).

`{{level}}` is the [numeric value](https://github.com/Seldaek/monolog/blob/main/src/Monolog/Level.php) of the log level. Debug == 100, etc

You can also use variables that exist in `LogEntry::$extra`. Given a message like

```
$l = new \Monolog\LogRecord(extra: ['foo' => 'bar']);
```

You could use a tag format of `myapp.{{foo}}` to produce a tag of `myapp.bar`.

Monolog processors
------------------

[](#monolog-processors)

You can add processors to the monolog handlers by adding them to the `processors` array within the `fluent.php` config.

config/fluent.php:

```
'processors' => [function (\Monolog\LogRecord $record) {
    $record->extra['cloudwatch_log_group'] = 'test_group';

    return $record;
}],
```

Alternatively, you can pass the class name of the processor. This helps keep your config compatible with `config:cache`

config/fluent.php:

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

CustomProcessor.php:

```
class CustomProcessor
{
    public function __invoke(\Monolog\LogRecord $record)
    {
        $record->extra['cloudwatch_log_group'] = 'test_group';

        return $record;
    }
}
```

Author
------

[](#author)

- [Yuuki Takezawa](mailto:yuuki.takezawa@comnect.jp.net) ([twitter](http://twitter.com/ex_takezawa))

License
-------

[](#license)

The code for laravel-fluent-logger is distributed under the terms of the MIT license.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 70.3% 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

Unknown

Total

1

Last Release

1080d ago

### Community

Maintainers

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

---

Top Contributors

[![ytake](https://avatars.githubusercontent.com/u/4454078?v=4)](https://github.com/ytake "ytake (71 commits)")[![pravindahal](https://avatars.githubusercontent.com/u/894731?v=4)](https://github.com/pravindahal "pravindahal (7 commits)")[![hrs-o](https://avatars.githubusercontent.com/u/7277266?v=4)](https://github.com/hrs-o "hrs-o (6 commits)")[![nitrogenium](https://avatars.githubusercontent.com/u/4016784?v=4)](https://github.com/nitrogenium "nitrogenium (5 commits)")[![bcismariu](https://avatars.githubusercontent.com/u/10166477?v=4)](https://github.com/bcismariu "bcismariu (4 commits)")[![rogervila](https://avatars.githubusercontent.com/u/6053012?v=4)](https://github.com/rogervila "rogervila (4 commits)")[![duxthefux](https://avatars.githubusercontent.com/u/6758162?v=4)](https://github.com/duxthefux "duxthefux (2 commits)")[![Dylan-DPC](https://avatars.githubusercontent.com/u/99973273?v=4)](https://github.com/Dylan-DPC "Dylan-DPC (1 commits)")[![crhg](https://avatars.githubusercontent.com/u/8174597?v=4)](https://github.com/crhg "crhg (1 commits)")

---

Tags

loglaravellogginglumenfluent

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/crhg-laravel-fluent-logger/health.svg)

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

###  Alternatives

[ytake/laravel-fluent-logger

fluent logger for laravel and lumen

63541.6k1](/packages/ytake-laravel-fluent-logger)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)[melihovv/laravel-log-viewer

A Laravel log viewer

1231.5k1](/packages/melihovv-laravel-log-viewer)

PHPackages © 2026

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