PHPackages                             moses/magento-log - 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. moses/magento-log

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

moses/magento-log
=================

Moses Magento Log

3.0.1(3y ago)1226.1k↓33.8%3PHP

Since Nov 9Pushed 2y ago1 watchersCompare

[ Source](https://github.com/mosesdinakaran/magento-log)[ Packagist](https://packagist.org/packages/moses/magento-log)[ RSS](/packages/moses-magento-log/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (1)Versions (9)Used By (0)

Magento Logging
===============

[](#magento-logging)

A very lightweight logging module that supports

- Rest Api Logging
- Elastic Search Logging
- GraphQl Logging
- RabbitMq Logging
- Varnish Cache Tag Bans Logging

No Core files is overridden or modified. These logging are implemented using plugins.

> ### Please note that, This extension is for debugging purpose only, Once enabled this extension will write all/partial request and response to the log file based on your configuration, So plz be advised that keeping this extension on enabled mode for a long time will fill up your disk space. Once the debugging is completed this needs to be disabled
>
> [](#please-note-that-this-extension-is-for-debugging-purpose-only-once-enabled-this-extension-will-write-allpartial-request-and-response-to-the-log-file-based-on-your-configuration-so-plz-be-advised-that-keeping-this-extension-on-enabled-mode-for-a-long-time-will-fill-up-your-disk-space-once-the-debugging-is-completed-this-needs-to-be-disabled)

To Install
----------

[](#to-install)

### For Magento Version &gt;= 2.4.4

[](#for-magento-version--244)

```
composer require moses/magento-log
php bin/magento module:enable Moses_Log
php bin/magento setup:upgrade

```

### For Magento Version &lt; 2.4.4

[](#for-magento-version--244-1)

```
composer require moses/magento-log 1.1.0
php bin/magento module:enable Moses_Log
php bin/magento setup:upgrade

```

#### Supported Logging

[](#supported-logging)

- Rest API Logging
- ElasticSearch Logging

For Magento version less than 2.4.4 if you need support for GraphQl logging plz try the below (Note its not tested from my end you can give a try)

- Add this commit in to your code base
- Post that download the version 2.1.0 directly from git and then put it under the app/code

Warning : This package is not install able via Composer 1.x, please make sure you upgrade to Composer 2+.

Alternatively you can download from github as well

API Logging
-----------

[](#api-logging)

Provides an option to log all/specific api calls.

In most of our environment we use different third party services such as order management, product management, product search , shipping management etc. These services interact with Magento using Rest APi'S.

At times, it would become very difficult to identify the root cause if we face any problem with these services.

Moreover, if we are in headless environment primarily using rest apis it would be really hard to identify the root cause for certain issues.

Consider a scenario where add to cart is not working for a particular customer only.

To effectively debug this issue, we would require the post data, headers etc that is posted by that particular user.

This extension would help you in this scenario. It has the feature that we can log the api request that is made by a specific user.

Let see the complete features of this extension.

[![Rest API logging](https://camo.githubusercontent.com/cf6d12a32ef3a7c74be55d3a0da06a0ad479f3a7e5345c4995ad34c104a2e2f9/68747470733a2f2f6d6f73657364696e616b6172616e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032332f30332f696d6167652d32362d31303234783334332e706e67)](https://camo.githubusercontent.com/cf6d12a32ef3a7c74be55d3a0da06a0ad479f3a7e5345c4995ad34c104a2e2f9/68747470733a2f2f6d6f73657364696e616b6172616e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032332f30332f696d6167652d32362d31303234783334332e706e67)

### Features

[](#features)

Enable or Disable Logging through Admin Configuration

Able to configure the api urls that needs to be logged using regular expression which will give endless opportunity to the developer to log a specific url

Few such ex are

- Able to log all the API logs
- Able to log logged in users API calls
- Able to log guest user API calls
- Able to log only a specific api calls such as custom api call, cart, CMS, Product, Order etc
- Able to log a specific user api calls.
- The API logs contain both the request and Response
- The logs are made in a separate file
- This extension doesn't override any CORE Api class.

This can be safely deployed in Production environment as its very lightweight.

### Configuration

[](#configuration)

Stores -&gt; Configuration -&gt; Moses Extensions -&gt; API Logging

Enable API Logging : To Enable all/selected api calls

Regular Expression Patterns: Define the regular expression pattern to log selected urls, For more than one urls use next line.

Ex

V1/carts/9 : Matches all urls for quote ID 9 that contains V1/carts/9

V1/carts/(\\d)\* : Matches for all quotes

V1/checkoutcomupapi/getTokenList : Match a specific url

Elastic Search Logging
----------------------

[](#elastic-search-logging)

At times there might me a case where you need to find out exactly what data is being pushed to elastic search and what is the response that we receive. This extension will help you to do that. It will log all the request and response of Elasticsearch from Magento.

### Configuration

[](#configuration-1)

Stores -&gt; Configuration -&gt; Moses Extensions -&gt; Elastic Search Logging

### How it works

[](#how-it-works)

The implementation is not very complicated its quiet simple though.

Magento uses the third party api client "elasticsearch/elasticsearch" to interact with Elasticsearch. This Extension by default has the feature of logging the request and responses.

\\Elasticsearch\\Connections\\Connection::logRequestSuccess

But while creating the instance of this elasticsearch model, Magento always set the logger to be NULL due to which the request never get logged. This extension through a plugin sets this logger to a custom logger, Due to which the requests and the response are logged.

GraphQl Logging
---------------

[](#graphql-logging)

To log the GraphQl Request and Response.

### Configuration

[](#configuration-2)

Stores -&gt; Configuration -&gt; Moses Extensions -&gt; Graphql Logging

[![Graphql logging](https://camo.githubusercontent.com/f980761efc42e5fa1387850fb219425469371babc713e2667d9e24bb2461e060/68747470733a2f2f6d6f73657364696e616b6172616e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032332f30332f696d6167652d32372d31303234783533302e706e67)](https://camo.githubusercontent.com/f980761efc42e5fa1387850fb219425469371babc713e2667d9e24bb2461e060/68747470733a2f2f6d6f73657364696e616b6172616e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032332f30332f696d6167652d32372d31303234783533302e706e67)

### Features

[](#features-1)

- Able to log GET/POST Requests or All Requests
- Able to log Based on HTTP Header Values
- Able to log Based on Query types
    - product : To log only the product query type
    - product,categories : To log both product and categories query types

RabbitMq Logging
----------------

[](#rabbitmq-logging)

To log the RabbitMq Messages that are send from Magento to RabbitMq Server or that are cosumed by Magento from RabbitMq.

### Configuration

[](#configuration-3)

Stores -&gt; Configuration -&gt; Moses Extensions -&gt; RabbitMq Logging

[![RabbitMq logging](https://camo.githubusercontent.com/4631c44e9dfeb2f21baa4de7f1f8dea6e0874be6dc5c5d5456291ed117cc7a5d/68747470733a2f2f6d6f73657364696e616b6172616e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032332f30332f696d6167652d32382d31303234783231302e706e67)](https://camo.githubusercontent.com/4631c44e9dfeb2f21baa4de7f1f8dea6e0874be6dc5c5d5456291ed117cc7a5d/68747470733a2f2f6d6f73657364696e616b6172616e2e636f6d2f77702d636f6e74656e742f75706c6f6164732f323032332f30332f696d6167652d32382d31303234783231302e706e67)

### Features

[](#features-2)

- Able to log Outgoing Messages (The Messages that are published to RabbitMq Server)
- Able to log Incoming Messages (The messages that are consumed from RabbitMq Server)

Varnish Cache Tags Logging
--------------------------

[](#varnish-cache-tags-logging)

To log the varnish purge cache tags, To know more on this [please refer here ](https://mosesdinakaran.com/magento-2-full-page-caching-with-varnish-in-depth/#Configure_Commerce_to_purge_Varnish)

### Configuration

[](#configuration-4)

Stores -&gt; Configuration -&gt; Moses Extensions -&gt; Log Varnish Cache Purging Tags

### Output

[](#output)

Once the Logging is enabled, The log data will be available in the below MAGE\_ROOT/var/log/moses-logging.log

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity35

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity55

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.3% 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 ~99 days

Recently: every ~124 days

Total

6

Last Release

1152d ago

Major Versions

1.1.0 → 2.1.02022-11-05

2.1.2 → 3.0.12023-03-24

### Community

Maintainers

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

---

Top Contributors

[![mosesdinakaran](https://avatars.githubusercontent.com/u/2908037?v=4)](https://github.com/mosesdinakaran "mosesdinakaran (33 commits)")[![AmooAti](https://avatars.githubusercontent.com/u/36756531?v=4)](https://github.com/AmooAti "AmooAti (7 commits)")[![mosesadobe](https://avatars.githubusercontent.com/u/52697673?v=4)](https://github.com/mosesadobe "mosesadobe (5 commits)")

### Embed Badge

![Health badge](/badges/moses-magento-log/health.svg)

```
[![Health](https://phpackages.com/badges/moses-magento-log/health.svg)](https://phpackages.com/packages/moses-magento-log)
```

###  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)[ekino/newrelic-bundle

Integrate New Relic into Symfony2

28111.2M8](/packages/ekino-newrelic-bundle)

PHPackages © 2026

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