PHPackages                             ddelosreyes/http-requests-logger-for-laravel - 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. ddelosreyes/http-requests-logger-for-laravel

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

ddelosreyes/http-requests-logger-for-laravel
============================================

A simple HTTP request logger for Laravel with buffered inserts and support for both relational databases and DynamoDB.

03PHP

Since Sep 7Pushed 8mo agoCompare

[ Source](https://github.com/delosreyesdan/http-requests-logger-for-laravel)[ Packagist](https://packagist.org/packages/ddelosreyes/http-requests-logger-for-laravel)[ RSS](/packages/ddelosreyes-http-requests-logger-for-laravel/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

📦 Http Requests Logger for Laravel
==================================

[](#-http-requests-logger-for-laravel)

🚧 WORK IN PROGRESS.
===================

[](#--work-in-progress)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b8b499ccd9c951261f0594fa411f96af125faee0617b4c254a9c308dfbcb5420/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f2f6464656c6f7372657965732f687474702d72657175657374732d6c6f676765722d666f722d6c61726176656c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages//ddelosreyes/http-requests-logger-for-laravel)

> Yet another HTTP request logger for Laravel — but built to be **fast, buffered, and flexible**.

This package logs incoming HTTP requests in **batches** to your preferred storage:

- ✅ **Database** (MySQL, Postgres, SQLite, etc.)
- ✅ **Redis buffer** (auto-flushed in batches)
- 🚧 DynamoDB support (coming soon)

---

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

[](#-features)

- 🔄 **Buffered logging** — requests are first pushed to Redis for efficiency.
- 🗄 **Pluggable storage** — store logs in your DB or Redis (configurable).
- ⚡️ **Batch inserts** — reduces DB overhead by inserting multiple logs at once.
- 🎛 **Configurable batch size &amp; Redis connection**.
- 🧪 **Pest + Testbench** powered test suite with Docker setup.

---

📥 Installation
--------------

[](#-installation)

Require the package via Composer:

```
composer require ddelosreyes/http-requests-logger-for-laravel
```

If auto-discovery is disabled, register the service provider manually:

```
// config/app.php
'providers' => [
    Ddelosreyes\\HttpRequestsLogger\\HttpRequestsLoggerServiceProvider::class,
];
```

Publish the config and migration:

```
php artisan vendor:publish --provider="Ddelosreyes\\HttpRequestsLogger\\HttpRequestsLoggerServiceProvider" --tag=config
php artisan vendor:publish --provider="Ddelosreyes\\HttpRequestsLogger\\HttpRequestsLoggerServiceProvider" --tag=migrations
php artisan migrate
```

---

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

[](#️-configuration)

In the config/http-requests-logger.php

```
return [
    'storage'    => env('HTTP_REQUEST_LOGGER_STORAGE', 'database'),
    'batch_size' => env('HTTP_REQUEST_LOGGER_BATCH_SIZE', 500),
    'table'      => env('HTTP_REQUEST_LOGGER_TABLE', 'http_request_logs'),

    'redis' => [
        'scheme'   => env('REDIS_SCHEME', 'tcp'),
        'host'     => env('REDIS_HOST', '127.0.0.1'),
        'port'     => env('REDIS_PORT', 6379),
        'password' => env('REDIS_PASSWORD', null),
        'database' => env('REDIS_DB', 0),
        'timeout'  => env('REDIS_TIMEOUT', 1.5),
    ],
];
```

In your dotenv

```
HTTP_REQUEST_LOGGER_STORAGE=database
HTTP_REQUEST_LOGGER_BATCH_SIZE=500
HTTP_REQUEST_LOGGER_TABLE=http_request_logs

REDIS_SCHEME=tcp
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_PASSWORD=null
REDIS_DB=0
```

---

🔍 How It Works
--------------

[](#-how-it-works)

1. Every incoming request is captured (method, URL, IP, user agent, headers, body)
2. Log payload is pushed to Redis (list)
3. Once the buffer reaches `batch_size`, logs are flushed into SQL in a single insert
4. Flush can also be triggered manually

---

📝 Logged Data
-------------

[](#-logged-data)

```
[
  'method'     => $request->getMethod(),
  'url'        => $request->getRequestUri(),
  'ip'         => $request->getClientIp(),
  'user_agent' => $request->getUserAgent(),
  'headers'    => json_encode($request->headers->all()),
  'body'       => json_encode($request->all()),
]
```

---

Usage
-----

[](#usage)

Option A: Middleware

```
// app/Http/Kernel.php
protected $middleware = [
    \Ddelosreyes\HttpRequestsLogger\Http\Middleware\LogHttpRequest::class,
];
```

Option B: Manually log in controller/job

```
use Ddelosreyes\HttpRequestsLogger\Actions\RequestLogBufferAction;

RequestLogBufferAction::add($request);
```

---

🧪 Testing
---------

[](#-testing)

This package is built with PestPHP + Orchestra Testbench.

Run tests locally with Docker:

```
make build
make test
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance43

Moderate activity, may be stable

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity13

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/fafe1fd345fece43883a5c66241b05f95f0f82da83b3d96e891327623f32a2a9?d=identicon)[ddelosreyes](/maintainers/ddelosreyes)

---

Top Contributors

[![delosreyesdan](https://avatars.githubusercontent.com/u/16068080?v=4)](https://github.com/delosreyesdan "delosreyesdan (10 commits)")

### Embed Badge

![Health badge](/badges/ddelosreyes-http-requests-logger-for-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/ddelosreyes-http-requests-logger-for-laravel/health.svg)](https://phpackages.com/packages/ddelosreyes-http-requests-logger-for-laravel)
```

###  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)
