PHPackages                             cleatsquad/magento2-logstream - 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. cleatsquad/magento2-logstream

ActiveMagento2-module[Logging &amp; Monitoring](/categories/logging)

cleatsquad/magento2-logstream
=============================

A Magento 2 module to redirect all logs to StdOut, ideal for dockerized environments.

1.0.0(2y ago)2232[1 PRs](https://github.com/CleatSquad/magento2-logstream/pulls)MITPHPPHP &gt;=8.1

Since Apr 12Pushed 5mo ago1 watchersCompare

[ Source](https://github.com/CleatSquad/magento2-logstream)[ Packagist](https://packagist.org/packages/cleatsquad/magento2-logstream)[ RSS](/packages/cleatsquad-magento2-logstream/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (5)Versions (4)Used By (0)

CleatSquad Magento 2 LogStream
==============================

[](#cleatsquad-magento-2-logstream)

A Magento 2 module that redirects all Magento logs to **StdOut**, making it ideal for **Docker** and **containerized environments**. This enables seamless log aggregation into external systems (ELK, Datadog, CloudWatch, etc.) without managing Magento-specific log files.

Badges
------

[](#badges)

[![Packagist Downloads](https://camo.githubusercontent.com/998409534479e6d35ab1d290d5fb9ef67ae896443141ff6dce3e1864cbc146b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f636c65617473717561642f6d6167656e746f322d6c6f6773747265616d3f636f6c6f723d626c7565)](https://packagist.org/packages/cleatsquad/magento2-logstream/stats)[![Packagist Version](https://camo.githubusercontent.com/c7bcaf26b37eed0deec27b5e1b48c4eb4c35c5abfbbf11df1d9ae58998c3db37/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636c65617473717561642f6d6167656e746f322d6c6f6773747265616d3f636f6c6f723d626c7565)](https://packagist.org/packages/cleatsquad/magento2-logstream)[![Packagist License](https://camo.githubusercontent.com/b438eb0722057344793d5d44169679067e74795663397dab2466a6a59f037adb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f636c65617473717561642f6d6167656e746f322d6c6f6773747265616d)](https://github.com/cleatsquad/magento2-logstream/blob/master/LICENSE.md)[![Magento 2.4.6 and above](https://camo.githubusercontent.com/7839d74abe80987cfce039d4d8a55fbd32d29fb88fa1ccfffc973e42e0191dcc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e34253230616e6425323061626f76652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/7839d74abe80987cfce039d4d8a55fbd32d29fb88fa1ccfffc973e42e0191dcc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4d6167656e746f2d322e34253230616e6425323061626f76652d627269676874677265656e2e7376673f7374796c653d666c6174)[![PHP 8.1+](https://camo.githubusercontent.com/502909c179f10c65831871e9bab2387afa73c9f17b9fb5a96f27ea95197061bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e7376673f7374796c653d666c6174)](https://camo.githubusercontent.com/502909c179f10c65831871e9bab2387afa73c9f17b9fb5a96f27ea95197061bb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e312532422d626c75652e7376673f7374796c653d666c6174)

---

✨ Features
----------

[](#-features)

- 🐳 **Docker-ready**: Logs to StdOut for seamless container integration.
- 📊 **External Log Aggregation**: Works with ELK, Datadog, CloudWatch, Splunk, etc.
- ⚙️ **Configurable Log Levels**: Set log level (DEBUG, INFO, WARNING, ERROR, etc.) from admin panel.
- 🛡️ **Clean DI Override**: Uses Magento dependency injection, no core hacks.
- 🎯 **Zero Configuration**: Works out of the box after installation.
- 🔄 **Real-time Logs**: Immediate log output without file I/O delays.
- 🧩 **Monolog Integration**: Built on Monolog's StreamHandler.

---

📦 Installation
--------------

[](#-installation)

You can install this module using Composer (recommended) or manually.

---

### 🔹 1. Install via Composer (recommended)

[](#-1-install-via-composer-recommended)

1. **Download the package**

    ```
    composer require cleatsquad/magento2-logstream
    ```
2. **Enable the module**

    ```
    bin/magento module:enable CleatSquad_LogStream
    bin/magento setup:upgrade
    ```

---

### 🔹 2. Manual Installation (app/code)

[](#-2-manual-installation-appcode)

1. **Copy the module to your Magento installation**

    ```
    app/code/CleatSquad/LogStream/

    ```
2. **Enable the module**

    ```
    bin/magento module:enable CleatSquad_LogStream
    bin/magento setup:upgrade
    ```

---

🚀 Usage
-------

[](#-usage)

Once installed, the module will automatically redirect all Magento logs to StdOut without any additional configuration.

### Viewing Logs in Docker

[](#viewing-logs-in-docker)

```
docker logs -f
```

### Example Log Output

[](#example-log-output)

```
[2024-01-15 10:30:45] main.INFO: User login successful {"username":"admin"} []
[2024-01-15 10:30:46] main.WARNING: Cache miss for product 123 [] []

```

---

⚙️ Configuration
----------------

[](#️-configuration)

To configure the log level for the CleatSquad Magento2 LogStream module, follow these steps in the Magento admin interface:

### Setting the Log Level

[](#setting-the-log-level)

1. Navigate to `Stores > Configuration` in the admin panel sidebar.
2. Under the `General` section, find and open the `Logging` group.
3. Select the desired log level from the `Log Level` dropdown menu.

### Available Log Levels

[](#available-log-levels)

LevelValueDescriptionDEBUG100Detailed debug informationINFO200Interesting events (default)NOTICE250Normal but significant eventsWARNING300Exceptional occurrences that are not errorsERROR400Runtime errorsCRITICAL500Critical conditionsALERT550Action must be taken immediatelyEMERGENCY600System is unusableChanges will take effect immediately after saving the configuration.

---

🔧 Technical Details
-------------------

[](#-technical-details)

### Architecture

[](#architecture)

This module works by:

1. **Overriding Monolog's handler**: Adds a custom `StdoutHandler` to Magento's logger via DI.
2. **Streaming to php://stdout**: All log messages are written directly to standard output.
3. **Respecting log levels**: Only logs at or above the configured level are output.

### DI Configuration

[](#di-configuration)

```

            CleatSquad\LogStream\Logger\StdoutHandler

```

---

🔄 Upgrading
-----------

[](#-upgrading)

To upgrade the module to the latest version, run:

```
composer update cleatsquad/magento2-logstream
bin/magento setup:upgrade
```

---

📋 Versioning
------------

[](#-versioning)

We use [SemVer](http://semver.org/) for versioning. For the versions available, see the [tags on this repository](https://github.com/cleatsquad/magento2-logstream/tags).

---

🔗 Follow
--------

[](#-follow)

For the latest updates and new features, follow our GitHub repository: [cleatsquad/magento2-logstream](https://github.com/cleatsquad/magento2-logstream).

---

🤝 Contributing
--------------

[](#-contributing)

Contributions to `CleatSquad_LogStream` are always welcome. You can contribute in different ways:

1. **Report Issues**: Report bugs and suggest new features.
2. **Fix Bugs**: Submit pull requests with bug fixes.
3. **Add Features**: Develop new features and submit them as pull requests.
4. **Improve Documentation**: Help new users by improving or translating the documentation.

Issues and pull requests are welcome.

GitHub:

---

💬 Support
---------

[](#-support)

If you need help or have a question, you can:

- Open an issue through GitHub for bug reports and feature requests.
- Check the [Magento Community Forums](https://community.magento.com/) for general questions and support on Magento.
- Check on [Magento Stack Exchange](https://magento.stackexchange.com/) for general programming questions.

---

👤 Authors
---------

[](#-authors)

- **Mohamed EL Mrabet** - *Initial work* - [mimou78](https://github.com/mimou78)

See also the list of [contributors](https://github.com/cleatsquad/magento2-logstream/contributors) who participated in this project.

---

📜 License
---------

[](#-license)

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.

---

🙏 Acknowledgments
-----------------

[](#-acknowledgments)

This module is powered by the excellent Monolog library:

➡️

- Magento Community
- Anyone who contributes to the open-source community

---

© 2024 - CleatSquad ()

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance56

Moderate activity, may be stable

Popularity11

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

757d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/75b8cb31786be9b4017a0c617eebe3a0cd3b8d039069ffad5bb5007b5510fd9d?d=identicon)[mimou78](/maintainers/mimou78)

---

Top Contributors

[![mohaelmrabet](https://avatars.githubusercontent.com/u/3817628?v=4)](https://github.com/mohaelmrabet "mohaelmrabet (3 commits)")[![renovate[bot]](https://avatars.githubusercontent.com/in/2740?v=4)](https://github.com/renovate[bot] "renovate[bot] (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cleatsquad-magento2-logstream/health.svg)

```
[![Health](https://phpackages.com/badges/cleatsquad-magento2-logstream/health.svg)](https://phpackages.com/packages/cleatsquad-magento2-logstream)
```

###  Alternatives

[justbetter/magento2-sentry

Magento 2 Logger for Sentry

1851.5M3](/packages/justbetter-magento2-sentry)[graycore/magento2-stdlogging

A Magento 2 module that changes all logging handlers to stdout

2382.6k](/packages/graycore-magento2-stdlogging)[corrivate/magento2-rest-api-logger

Advanced and convenient logging

2146.2k1](/packages/corrivate-magento2-rest-api-logger)[mage-os/module-admin-activity-log

The Admin Activity extension makes it easy to track all admin activity with comprehensive audit logging.

261.4k](/packages/mage-os-module-admin-activity-log)[ampersand/magento2-log-correlation-id

Magento 2 correlation id for requests and logs

279.9k](/packages/ampersand-magento2-log-correlation-id)

PHPackages © 2026

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