PHPackages                             cndrsdrmn/http-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. [Logging &amp; Monitoring](/categories/logging)
4. /
5. cndrsdrmn/http-logger

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

cndrsdrmn/http-logger
=====================

Logging http request and response

v1.2.0(3y ago)0539MITPHPPHP ^7.4|^8.0|^8.1

Since Apr 29Pushed 3y ago1 watchersCompare

[ Source](https://github.com/cndrsdrmn/http-logger)[ Packagist](https://packagist.org/packages/cndrsdrmn/http-logger)[ Docs](https://github.com/cndrsdrmn/http-logger)[ RSS](/packages/cndrsdrmn-http-logger/feed)WikiDiscussions main Synced 1mo ago

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

HTTP Logger
===========

[](#http-logger)

[![Latest Version on Packagist](https://camo.githubusercontent.com/0ebf72333f788c6c014d81f418c9bb893c39798fcefc7e988d7e311435052523/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636e64727364726d6e2f687474702d6c6f676765722e737667)](https://packagist.org/packages/cndrsdrmn/http-logger)[![Testing](https://github.com/cndrsdrmn/http-logger/actions/workflows/github-ci.yml/badge.svg)](https://github.com/cndrsdrmn/http-logger/actions/workflows/github-ci.yml)[![GitHub](https://camo.githubusercontent.com/540172e7a4765337f425b2079dfaf262896dcd926bf672156641ea8d8750c573/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f636e64727364726d6e2f687474702d6c6f67676572)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/4c92993b3657707e1ee88552d8d5ea8f9c3b505c6d7a0dbf4f1db92cceea8c44/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f636e64727364726d6e2f687474702d6c6f676765722e737667)](https://packagist.org/packages/cndrsdrmn/http-logger)

This package adds a middleware for writing a log of incoming requests and out-coming responses.

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

[](#installation)

Install the package via composer:

```
composer require cndrsdrmn/http-logger
```

Optionally you can publish the config file with:

```
php artisan vendor:publish --provider="Cndrsdrmn\HttpLogger\HttpLoggerServiceProvider" --tag="config"
```

This is the contents of the published config file:

```
return [

	/*
	 |-----------------------------------------------------------
	 | HTTP Logger Channel
	 |-----------------------------------------------------------
	 */
	'channel' => env('HTTP_LOGGER_CHANNEL', env('LOG_CHANNEL', 'stack')),

	/*
	 |-----------------------------------------------------------
	 | Masking Fields
	 |-----------------------------------------------------------
	 |
	 | Sometimes you need to keep field values secretly.
	 | You can register a field on this "masking" key to keep its value secret.
	 | Masked a request "body", "query" and "headers".
	 */
	'masking' => [
	    'password',
	    'password_confirmation',
	],

	/*
	 |-----------------------------------------------------------
	 | Skip Endpoints
	 |-----------------------------------------------------------
	 |
	 | Sometimes, you need to skip recording a log for whitelist endpoints.
	 | Example: '/foo/bar', '/foo/*'
	 */
	'skip_endpoints' => [],

	/*
	 |-----------------------------------------------------------
	 | Skip IPs Address
	 |-----------------------------------------------------------
	 |
	 | Sometimes, you need to skip recording a log for whitelist IPs address.
	 | Example: '192.168.0.10', '172.10.0.*', '172.9.*',
	 */
	'skip_ips' => [],
];
```

Configuration
-------------

[](#configuration)

We recommend making a new channel in `config/logging.php` for handling the HTTP Logger.
By default, we use the `stack` channel for handling this. You can override with put the variable `HTTP_LOGGER_CHANNEL` in the `.env` file.

```
// in config/logging.php

'channels' => [
    // ...
    'http-logger' => [
        'driver' => 'daily',
        'path' => storage_path('logs/http-loggers/http-logger.log'),
        'level' => 'debug',
        'days' => 14,
    ],
    // ...
]

// in .env file
HTTP_LOGGER_CHANNEL=http-logger
```

For lumen your need enable `withFacades` at `bootstrap/app.php`.

```
$app->withFacades();
```

Usage
-----

[](#usage)

### 1. Laravel

[](#1-laravel)

This package provides a middleware that can be added as a global middleware or as a single route.
Please see [official documentation](https://laravel.com/docs/9.x/middleware#registering-middleware) for more information.

```
// in app/Http/Kernel.php
protected $middleware = [
    // ...
    \Cndrsdrmn\HttpLogger\Middleware\HttpLogger::class,
];

// in a routes file
Route::post('foo', function () {
    // action here
})->middleware(\Cndrsdrmn\HttpLogger\Middleware\HttpLogger::class);
```

### 2. Lumen

[](#2-lumen)

This package provides a middleware that can be added as a global middleware or as a single route.
Please see [official documentation](https://lumen.laravel.com/docs/9.x/middleware#registering-middleware) for more information.

```
// in bootstrap/app.php

// Global Middleware
$app->middleware([
   \Cndrsdrmn\HttpLogger\Middleware\HttpLogger::class,
]);

// OR Assigning Middleware To Routes
$app->routeMiddleware([
    'http-logger' => \Cndrsdrmn\HttpLogger\Middleware\HttpLogger::class,
]);

// in routes file
$router->get('/', ['middleware' => ['http-logger'], function () {
    //
}]);
```

Create/copy a configuration file from [here](config/http-logger.php) into `config/http-logger.php` then registering a configuration at `bootstrap/app.php`.

```
$app->configure('http-logger');
```

Testing
-------

[](#testing)

```
composer test
```

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [Candra Sudirman](https://github.com/cndrsdrmn)
- [All Contributors](https://github.com/cndrsdrmn/http-logger/graphs/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Total

4

Last Release

1454d ago

### Community

Maintainers

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

---

Top Contributors

[![candra-bridgenote](https://avatars.githubusercontent.com/u/79818218?v=4)](https://github.com/candra-bridgenote "candra-bridgenote (2 commits)")

---

Tags

laravellogginglumenhttp-logger

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/cndrsdrmn-http-logger/health.svg)

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

###  Alternatives

[rap2hpoutre/laravel-log-viewer

A Laravel log reader

3.2k14.7M70](/packages/rap2hpoutre-laravel-log-viewer)[ytake/laravel-fluent-logger

fluent logger for laravel and lumen

63541.6k1](/packages/ytake-laravel-fluent-logger)[melihovv/laravel-log-viewer

A Laravel log viewer

1231.5k1](/packages/melihovv-laravel-log-viewer)[shaffe/laravel-mail-log-channel

A package to support logging via email in Laravel

1286.2k](/packages/shaffe-laravel-mail-log-channel)

PHPackages © 2026

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