PHPackages                             betterde/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. betterde/logger

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

betterde/logger
===============

Elasticsearch logger handler

v2.2.0(4y ago)3231.5k↓16.1%6[1 issues](https://github.com/betterde/logger/issues)MITPHP

Since Nov 24Pushed 4y ago1 watchersCompare

[ Source](https://github.com/betterde/logger)[ Packagist](https://packagist.org/packages/betterde/logger)[ Fund](https://betterde.github.io/ects/introduction/more.html)[ RSS](/packages/betterde-logger/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (4)Versions (29)Used By (0)

Laravel log driver for elasticsearch
====================================

[](#laravel-log-driver-for-elasticsearch)

Installation
============

[](#installation)

```
$ composer require betterde/logger
$ php artisan vendor:publish --tag=betterde.logger
```

Config
======

[](#config)

You can modify config in `config/logger.php`.

Now we can add the `channel` of `channels` in `config/logging.php` file.

```
use Betterde\Logger\ElasticsearchLogger;

'channels' => [
    'elastic' => [
        'driver' => 'custom',
        'via' => ElasticsearchLogger::class,
    ],
],
```

Add the `\Betterde\Logger\Http\Middleware\BulkCollectionLog` middleware to `App\Http\Kernel.php` file.

```
/**
 * The application's global HTTP middleware stack.
 *
 * These middleware are run during every request to your application.
 *
 * @var array
 */
protected $middleware = [
    \Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode::class,
    \Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
    \App\Http\Middleware\TrimStrings::class,
    \Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
    \App\Http\Middleware\TrustProxies::class,
    \Betterde\Logger\Http\Middleware\BulkCollectionLog::class
];
```

Now define the environment variable in `.env` file like this:

```
LOG_CHANNEL=elastic
ELASTICSEARCH_HOST=localhost
ELASTICSEARCH_PORT=9200
ELASTICSEARCH_SCHEME=http
ELASTICSEARCH_USER=
ELASTICSEARCH_PASS=

```

Finally, I hope this is helpful.

Sponsors
========

[](#sponsors)

[![jetbrains](jetbrains.svg)](https://www.jetbrains.com/?from=ects)

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity39

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 89.2% 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 ~32 days

Recently: every ~90 days

Total

28

Last Release

1545d ago

Major Versions

1.7.0 → 2.0.02019-11-26

1.8.1 → 2.1.02019-11-27

1.8.2 → 2.1.12019-11-28

1.8.4 → 2.1.22019-12-19

1.8.7 → 2.1.42020-03-31

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c85593d180ab34bd56247c69debca02794f8f07b7ee0737fc897164858de6b1?d=identicon)[GeorgeKing](/maintainers/GeorgeKing)

---

Top Contributors

[![jinrenjie](https://avatars.githubusercontent.com/u/5665135?v=4)](https://github.com/jinrenjie "jinrenjie (33 commits)")[![lsrz](https://avatars.githubusercontent.com/u/27991805?v=4)](https://github.com/lsrz "lsrz (3 commits)")[![hiramrx](https://avatars.githubusercontent.com/u/29945391?v=4)](https://github.com/hiramrx "hiramrx (1 commits)")

---

Tags

elasticsearchlogger

### Embed Badge

![Health badge](/badges/betterde-logger/health.svg)

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

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[flow-php/flow

PHP ETL - Extract Transform Load - Data processing framework

85036.3k](/packages/flow-php-flow)[guanguans/laravel-exception-notify

Monitor exception and report to the notification channels(Log、Mail、AnPush、Bark、Chanify、DingTalk、Discord、Gitter、GoogleChat、IGot、Lark、Mattermost、MicrosoftTeams、NowPush、Ntfy、Push、Pushback、PushBullet、PushDeer、PushMe、Pushover、PushPlus、QQ、RocketChat、ServerChan、ShowdocPush、SimplePush、Slack、Telegram、WeWork、WPush、XiZhi、YiFengChuanHua、ZohoCliq、ZohoCliqWebHook、Zulip).

14845.8k1](/packages/guanguans-laravel-exception-notify)[lion/bundle

Lion-framework configuration and initialization package

122.3k4](/packages/lion-bundle)

PHPackages © 2026

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