PHPackages                             ydalbj/monolog-elasticsearch-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. ydalbj/monolog-elasticsearch-logger

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

ydalbj/monolog-elasticsearch-logger
===================================

基于laravel的monolog日志Elasticsearch存储通道

v0.2(6y ago)09PHPCI failing

Since Jan 11Pushed 6y ago1 watchersCompare

[ Source](https://github.com/ydalbj/monolog-elasticsearch-logger)[ Packagist](https://packagist.org/packages/ydalbj/monolog-elasticsearch-logger)[ RSS](/packages/ydalbj-monolog-elasticsearch-logger/feed)WikiDiscussions master Synced today

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

monolog-es-logger
=================

[](#monolog-es-logger)

monolog-es-logger是基于laravel的monolog日志Elasticsearch存储通道

项目规范
----

[](#项目规范)

-本项目所有文件使用Unix风格换行符LF

项目配置
----

[](#项目配置)

-.gitattributes .text配置为eol=lf。强制使用Unix风格换行符 -git全局配置safecrlf=true，强制检查是否混合Windows和Unix风格换行符

使用
--

[](#使用)

1. 固定monolog版本

    > 因monolog版本1.24存在无法写入Elasticsearch的问题，所以要在项目composer.json中固定monolog版本

    ```
    "monolog/monolog": "1.23",
    ```
2. 引入类库

    ```
    $ composer require ydalbj/monolog-elasticsearch-logger
    ```
3. 修改日志配置

    - 修改laravel项目 config/logging.php, 增加自定义通道

    ```
            'elasticsearch' => [
                'driver' => 'custom',
                'via' => \Wobatu\Logger\ElasticsearchLogger::class,
                'level' => 'debug',
                'connection' => [
                    'host' => 'localhost',
                    'port' => 9200,
                ],
                'index' => 'monolog',
                'days' => 7,
                // 'tags' => ['58cmd'],
            ],
    ```

    - 配置默认日志通道

        修改环境变量为`LOG_CHANNEL=elasticsearch` 或者配置stack通道，添加通道`elasticsearch`

###  Health Score

23

—

LowBetter than 25% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 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 ~563 days

Total

2

Last Release

2209d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/7308871?v=4)[Liu Hui](/maintainers/ydalbj)[@ydalbj](https://github.com/ydalbj)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ydalbj-monolog-elasticsearch-logger/health.svg)

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

###  Alternatives

[symfony/monolog-bridge

Provides integration for Monolog with various Symfony components

2.6k208.8M397](/packages/symfony-monolog-bridge)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.7k39.6k](/packages/matomo-matomo)[illuminate/log

The Illuminate Log package.

6225.7M683](/packages/illuminate-log)[spatie/flare-client-php

Send PHP errors to Flare

178166.2M24](/packages/spatie-flare-client-php)[tempest/framework

The PHP framework that gets out of your way.

2.3k37.6k20](/packages/tempest-framework)

PHPackages © 2026

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