PHPackages                             daisanmu/laravel-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. daisanmu/laravel-http-logger

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

daisanmu/laravel-http-logger
============================

A Laravel 5 package to log HTTP requests

1.1.4(7y ago)08MITPHPPHP ^7.1

Since Oct 18Pushed 7y ago1 watchersCompare

[ Source](https://github.com/daisanmu/laravel-http-logger)[ Packagist](https://packagist.org/packages/daisanmu/laravel-http-logger)[ Docs](https://github.com/daisanmu/laravel-http-logger)[ RSS](/packages/daisanmu-laravel-http-logger/feed)WikiDiscussions master Synced today

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

Log HTTP requests
=================

[](#log-http-requests)

[![Latest Version on Packagist](https://camo.githubusercontent.com/61685982b5ca7db340cf3f5d43ab4f2959c5f6b9b4a75d79861346e9d87bbd30/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7370617469652f6c61726176656c2d687474702d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-http-logger)[![Build Status](https://camo.githubusercontent.com/440a7d3d47a1758a115e6a7034b8100e6eb0f839996d45397a733d296a2e4f04/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7370617469652f6c61726176656c2d687474702d6c6f676765722f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/spatie/laravel-http-logger)[![Quality Score](https://camo.githubusercontent.com/43cc0a43f68c4feffe76e70536a869b3cb48bc6f5d0aa8561949e695bb4feee8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f7370617469652f6c61726176656c2d687474702d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/spatie/laravel-http-logger)[![Total Downloads](https://camo.githubusercontent.com/4a529fe2f90d2d9c9657f61dd269c00e89e0b648508aa7e063def28e71d73c00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7370617469652f6c61726176656c2d687474702d6c6f676765722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/spatie/laravel-http-logger)

功能描述： 日志中间件，可通过route指定中间件来记录http请求的 header ,body,ip,response信息。并且当response错误时可发生邮件到指定邮箱（这需要配置好laravel自带的Mail）。 这些参数都是可配置的。配置文件如下。

记录的log是在storage/log下，命名规则是每天一个request.log文件。

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

[](#installation)

You can install the package via composer:

```
composer require daisanmu/laravel-http-logger
```

Optionally you can publish the configfile with:

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

This is the contents of the published config file:

```
return [

    /*
     * The log profile which determines whether a request should be logged.
     * It should implement `LogProfile`.
     */
    'log_profile' => \Daisanmu\HttpLogger\LogNonGetRequests::class,

    /*
     * The log writer used to write the request to a log.
     * It should implement `LogWriter`.
     */
    'log_writer' => \Daisanmu\HttpLogger\DefaultLogWriter::class,

    /*
     * Filter out body fields which will never be logged.
     */
    'except' => [
        'password',
        'password_confirmation',
    ],
    /*
     * Filter out header fields which will never be logged.
     */
    'except_header' => [
        'postman-token',
        'accept',
        'accept-language',
        'accept-encoding',
        'cache-control',
        'content-type',
        'content-length',
        'connection',
        'host',
        'user-agent',
        'origin'
    ],
    /**
     *指定错误发送邮件
    */
    'send_mail_status' => [
        '500'
    ],
    /**
     *指定到指定邮箱，需要配置laravel的Mail
    */
    'send_to' => [
        '10503331@qq.com'
    ]
];
```

Usage
-----

[](#usage)

This packages provides a middleware which can be added as a global middleware or as a single route.

```
// in `app/Http/Kernel.php`

protected $middleware = [
    // ...

    \Spatie\HttpLogger\Middlewares\HttpLogger::class
];
```

```
// in a routes file

Route::post('/submit-form', function () {
    //
})->middleware(\Spatie\HttpLogger\Middlewares\HttpLogger::class);
```

在spatie/laravel-http-logger 基础上增加记录header IP 和response信息，当response为指定错误码时可发送邮件

```

fork 自 https://github.com/spatie/laravel-http-logger

## License

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

```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 50.7% 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 ~83 days

Recently: every ~76 days

Total

6

Last Release

2709d ago

PHP version history (2 changes)1.0.0PHP ^7.0

1.1.2PHP ^7.1

### Community

Maintainers

![](https://www.gravatar.com/avatar/72b2e0bb0828d16d3e85aa3ca4ba75b0d1a241f5d29b837974ca9f825b47c67d?d=identicon)[royeedai](/maintainers/royeedai)

---

Top Contributors

[![freekmurze](https://avatars.githubusercontent.com/u/483853?v=4)](https://github.com/freekmurze "freekmurze (35 commits)")[![brendt](https://avatars.githubusercontent.com/u/6905297?v=4)](https://github.com/brendt "brendt (25 commits)")[![sebastiandedeyne](https://avatars.githubusercontent.com/u/1561079?v=4)](https://github.com/sebastiandedeyne "sebastiandedeyne (7 commits)")[![Okipa](https://avatars.githubusercontent.com/u/5328934?v=4)](https://github.com/Okipa "Okipa (1 commits)")[![pdewit](https://avatars.githubusercontent.com/u/488574?v=4)](https://github.com/pdewit "pdewit (1 commits)")

---

Tags

laravel-http-loggerdaisanmu

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-http-logger

A Laravel package to log HTTP requests

6744.4M11](/packages/spatie-laravel-http-logger)[spatie/laravel-health

Monitor the health of a Laravel application

85810.0M83](/packages/spatie-laravel-health)[yadahan/laravel-authentication-log

Laravel Authentication Log provides authentication logger and notification for Laravel.

416632.8k5](/packages/yadahan-laravel-authentication-log)[kitloong/laravel-app-logger

Laravel log for your application

101.2M8](/packages/kitloong-laravel-app-logger)[label84/laravel-auth-log

Log user authentication actions in Laravel.

3654.0k](/packages/label84-laravel-auth-log)[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)
