PHPackages                             sec-dojo-com/laravel-ecs-logging - 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. sec-dojo-com/laravel-ecs-logging

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

sec-dojo-com/laravel-ecs-logging
================================

Adding ECS (Elastic Common Schema) Logging to Laravel (Updated).

02.6kPHP

Since Feb 14Pushed 1y agoCompare

[ Source](https://github.com/sec-dojo-com/laravel-ecs-logging)[ Packagist](https://packagist.org/packages/sec-dojo-com/laravel-ecs-logging)[ RSS](/packages/sec-dojo-com-laravel-ecs-logging/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Laravel Elastic Common Scheme (ECS) Logging
===========================================

[](#laravel-elastic-common-scheme-ecs-logging)

This package adds ECS (Elastic Common Scheme) format to your laravel application allowing to log your standard logs to elastic.

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

[](#installation)

You can install the package via composer:

```
composer require sec-dojo-com/laravel-ecs-logging
```

It's recommended to require `jenssegers/agent` which will add user agent logging support.

```
composer require jenssegers/agent
```

Optionally, you can publish the config file with:

```
php artisan vendor:publish --provider="AviationCode\EcsLogging\EcsLoggingServiceProvider" --tag="config"
```

Register log driver in `config/logging.php`

```
return [
    'channels' => [
        // ... Other channels

        'ecs' => [
            'driver' => 'ecs',
            'path' => storage_path('logs/ecs/laravel.json'),
            'level' => 'debug',
            'days' => 14,
        ],
    ]
];
```

If you want to use this driver as the only logging method define `LOG_CHANNEL=ecs` in your `.env` or add the `ecs` channel into your stack driver.

All `Log::xxx()` calls get logged into json file. This file can be picked up by filebeat which sends it to your logstash or elasticsearch instance.

### Configure filebeat

[](#configure-filebeat)

Add the following to your `/etc/filebeat/filebeat.yml` file

```
filebeat.inputs:
    - type: log
      enabled: true
      paths:
          - /path-to-your-laravel-app/storage/logs/ecs/*.json
      json:
          message_key: message
          keys_under_root: true
          overwrite_keys: true
```

Bugs:
-----

[](#bugs)

Current bugs within the ecs-logs package:

- `Typed static property Aviation Code\Ecs Logging\Tracing\Correlate::$id must not be accessed before initialization`. This is due to trying to access type hinted properties statically before assigning values to them, this was fixed by initialising them with null values.

Original repository
-------------------

[](#original-repository)

This package is a fork of [AviationCode\\EcsLogging](https://github.com/AviationCode/laravel-ecs-logging). With updates and bug fixes.

### Fork Changelog:

[](#fork-changelog)

13/05/2022: Added the option to disable log file rotation through config file (Use the option `disable_rotate`)

Credits
-------

[](#credits)

- [Ken Andries](https://github.com/DouglasDC3)
- [Rami Badr](https://github.com/RamiBadrPRo)
- [El Mahdi Sidate](https://github.com/esidate)

License
-------

[](#license)

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

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity23

Early-stage or recently created project

 Bus Factor1

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

### Community

Maintainers

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

---

Top Contributors

[![Douglasdc3](https://avatars.githubusercontent.com/u/5066883?v=4)](https://github.com/Douglasdc3 "Douglasdc3 (9 commits)")[![esidate](https://avatars.githubusercontent.com/u/59918011?v=4)](https://github.com/esidate "esidate (2 commits)")[![RamiBadrPRo](https://avatars.githubusercontent.com/u/22303041?v=4)](https://github.com/RamiBadrPRo "RamiBadrPRo (1 commits)")

### Embed Badge

![Health badge](/badges/sec-dojo-com-laravel-ecs-logging/health.svg)

```
[![Health](https://phpackages.com/badges/sec-dojo-com-laravel-ecs-logging/health.svg)](https://phpackages.com/packages/sec-dojo-com-laravel-ecs-logging)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.2k](/packages/psr-log)[itsgoingd/clockwork

php dev tools in your browser

5.9k27.6M94](/packages/itsgoingd-clockwork)[graylog2/gelf-php

A php implementation to send log-messages to a GELF compatible backend like Graylog2.

41838.2M138](/packages/graylog2-gelf-php)[bugsnag/bugsnag-psr-logger

Official Bugsnag PHP PSR Logger.

32132.5M2](/packages/bugsnag-bugsnag-psr-logger)[consolidation/log

Improved Psr-3 / Psr\\Log logger based on Symfony Console components.

15462.2M7](/packages/consolidation-log)[datadog/php-datadogstatsd

An extremely simple PHP datadogstatsd client

19124.6M15](/packages/datadog-php-datadogstatsd)

PHPackages © 2026

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