PHPackages                             outl1ne/laravel-elastic-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. outl1ne/laravel-elastic-logger

ActiveLibrary

outl1ne/laravel-elastic-logger
==============================

Laravel Elastic Cloud logging for MessageLogged event.

1.2.0(3y ago)32.8k↓100%1MITPHPPHP &gt;=8.0

Since Dec 29Pushed 3y ago3 watchersCompare

[ Source](https://github.com/outl1ne/laravel-elastic-logger)[ Packagist](https://packagist.org/packages/outl1ne/laravel-elastic-logger)[ RSS](/packages/outl1ne-laravel-elastic-logger/feed)WikiDiscussions main Synced today

READMEChangelog (10)Dependencies (2)Versions (15)Used By (0)

Laravel Elastic Cloud logging for MessageLogged event.
======================================================

[](#laravel-elastic-cloud-logging-for-messagelogged-event)

This package will listen to the *Illuminate\\Log\\Events\\MessageLogged* event and queue the log data to be sent to Elastic Kibana index by your queue handler.

It will listen to all Log events and will also handle exceptions separately.

---

### Requirements

[](#requirements)

```
- PHP >=8.0
- laravel/framework ^8.7 || ^9.0

```

### Dependencies

[](#dependencies)

```
"elasticsearch/elasticsearch": "^8.5"
```

---

Important notice
----------------

[](#important-notice)

Do not log Queue::before / after events. This will cause an infinite loop of logging and will cause your application to crash.

#### In general be careful about the possibility of log loops.

[](#in-general-be-careful-about-the-possibility-of-log-loops)

Tested with redis and database queue drivers.

If you're working on Google cloud, consider setting up [stackkits laravel-google-cloud-tasks-queue](https://github.com/stackkit/laravel-google-cloud-tasks-queue)

---

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

[](#installation)

Install package

```
composer require outl1ne/laravel-elastic-logger
```

Configure the environment variables for the package

```
ELASTIC_ENABLED=true # only 'true' value will enable MessageLogged event being listened
ELASTIC_INDEX= # index where to send the logs
ELASTIC_CLOUD_ID= # your elastic instance cloud ID
ELASTIC_API_KEY= # your elastic API key
ELASTIC_EXCLUDE_LOG_LEVELS= # comma separated log levels to be excluded, IE: "info,warning"
ELASTIC_LIFECYCLE_POLICY= # lifecycle policy name for setting: body.settings.index.lifecycle.name. if not assigned not set.
```

Make sure your [queue handler](https://laravel.com/docs/9.x/queues#driver-prerequisites) is configured properly

---

Cheat sheet / quick guide to set up Elastic.
--------------------------------------------

[](#cheat-sheet--quick-guide-to-set-up-elastic)

Elastic offers 14 day free trial.

This package will auto-generate the indexes for you based on the ELASTIC\_INDEX value. It will create indexes in the pattern of: `ELASTIC_INDEX + _ + d-m-Y`

1. [Create an account](https://cloud.elastic.co)
2. Create a new instance.
3. Create a new Kibana Data view. Choose a name and match the index pattern with the index name you created. Kibana allows wildcards.

##### Choose the "datetime" field as the Timestamp field! This is important to allow convenient filtering based on the timestamp.

[](#choose-the-datetime-field-as-the-timestamp-field-this-is-important-to-allow-convenient-filtering-based-on-the-timestamp)

Elastic is able to create a new index on the fly but you cannot change the datetime field for the timestamp later, which will result in not having a proper timestamp filter.

Save the data view and view your newly created data view in the "Discover" section in the Analytics.

---

What the future brings
----------------------

[](#what-the-future-brings)

- lifecycle policy management

---

License
-------

[](#license)

This project is open-sourced software licensed under the [MIT license](LICENSE.md).

###  Health Score

30

—

LowBetter than 67% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Total

14

Last Release

1139d ago

PHP version history (2 changes)1.0.0PHP &gt;=8.0

1.0.7PHP &gt;=8.7

### Community

Maintainers

![](https://www.gravatar.com/avatar/9ef13eb975a9d63eed0f9b90b0d266e96ea3bfa1ba262f6689e07c9f17fa2b84?d=identicon)[rraadi](/maintainers/rraadi)

---

Top Contributors

[![richard-raadi](https://avatars.githubusercontent.com/u/69033947?v=4)](https://github.com/richard-raadi "richard-raadi (17 commits)")

---

Tags

laravelelastic

### Embed Badge

![Health badge](/badges/outl1ne-laravel-elastic-logger/health.svg)

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

###  Alternatives

[jeroen-g/explorer

Next-gen Elasticsearch driver for Laravel Scout.

399590.5k](/packages/jeroen-g-explorer)

PHPackages © 2026

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