PHPackages                             phong/module-apilogger - 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. phong/module-apilogger

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

phong/module-apilogger
======================

Api Logger for Magento 2

00PHP

Since Mar 18Pushed 1mo agoCompare

[ Source](https://github.com/phongnguyen1412/ApiLogger)[ Packagist](https://packagist.org/packages/phong/module-apilogger)[ RSS](/packages/phong-module-apilogger/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Rest API Logger for Magento 2
=============================

[](#rest-api-logger-for-magento-2)

Overview
--------

[](#overview)

**Rest API Logger** is a Magento 2 extension used to log all incoming REST API requests and their corresponding responses. It helps developers and administrators monitor API activities, troubleshoot integration issues, and audit system behavior.

The extension stores log data in both:

- Database (Admin Grid View)
- Magento log files (`var/log`)

---

Features
--------

[](#features)

- Log all REST API requests
- Log API responses and status
- Store request payload
- Store response payload
- Admin grid to view API logs
- Export log data
- Mass purge logs from admin
- File-based logging for server debugging
- Timestamp tracking

---

Logged Information
------------------

[](#logged-information)

Each log record contains:

- Request Method (GET, POST, PUT, DELETE, etc.)
- API Endpoint / Path
- Request Input Data
- Response Output Data
- Status
- Created Time

---

Log Storage
-----------

[](#log-storage)

### Database Table

[](#database-table)

```
phong_logger_api

```

Accessible via Magento Admin.

### Log File

[](#log-file)

```
var/log/rest_api_logger.log

```

---

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

[](#installation)

### Method 1 — Manual Installation

[](#method-1--manual-installation)

1. Download the extension source code.
2. Copy the module to:

```
app/code/Phong/ApiLogger

```

3. Run Magento commands:

```
php bin/magento module:enable Phong_ApiLogger
php bin/magento setup:upgrade
php bin/magento cache:flush
```

---

### Method 2 — Installation via Composer

[](#method-2--installation-via-composer)

Run:

```
composer require phong/module-apilogger
```

Then execute:

```
php bin/magento module:enable Phong_ApiLogger
php bin/magento setup:upgrade
php bin/magento cache:flush
```

---

Admin Usage
-----------

[](#admin-usage)

After installation, API logs can be viewed in Magento Admin Panel.

Example navigation:

```
Admin → System → Rest API Logger

```

---

Recommendations
---------------

[](#recommendations)

- Regularly purge old logs to avoid large database size.
- Logging can impact performance if API traffic is very high.
- Recommended for debugging, monitoring, and auditing purposes.

---

Future Plan
-----------

[](#future-plan)

### Auto Cleanup of Old Logs

[](#auto-cleanup-of-old-logs)

- Support automatic removal of outdated log records from the database.
- Configurable retention period (e.g., remove logs older than X days).
- Scheduled cleanup via Magento Cron.
- Helps prevent database growth and improves system performance.

### GraphQL Logging Support

[](#graphql-logging-support)

- Extend logging capability to capture GraphQL requests and responses.
- Record query name, variables, execution status, and response payload.
- Provide unified monitoring for both REST and GraphQL API traffic.

### URL-Based Logging Control

[](#url-based-logging-control)

- Allow administrators to include or exclude specific API endpoints from logging.
- Support configuration of whitelist / blacklist URL patterns.
- Helps reduce unnecessary logging and improves performance in high-traffic environments.

---

Compatibility
-------------

[](#compatibility)

- Magento Open Source **2.4.6+**
- Magento Commerce **2.4.6+**
- PHP **8.1+**

---

Author
------

[](#author)

Phong

###  Health Score

19

—

LowBetter than 10% of packages

Maintenance59

Moderate activity, may be stable

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/3750c017adf319f167d093cee9f55b68a9ac439510cf6a757efb537c19e30d68?d=identicon)[phongnguyen1412](/maintainers/phongnguyen1412)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/phong-module-apilogger/health.svg)

```
[![Health](https://phpackages.com/badges/phong-module-apilogger/health.svg)](https://phpackages.com/packages/phong-module-apilogger)
```

###  Alternatives

[psr/log

Common interface for logging libraries

10.4k1.2B9.1k](/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.2M137](/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)
