PHPackages                             prettus/laravel-request-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. prettus/laravel-request-logger

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

prettus/laravel-request-logger
==============================

HTTP request logger middleware for Laravel

1.2.0(8y ago)24746.8k↓73.8%57[11 issues](https://github.com/andersao/laravel-request-logger/issues)[6 PRs](https://github.com/andersao/laravel-request-logger/pulls)1MITPHPPHP &gt;=5.4.0

Since Apr 6Pushed 7y ago8 watchersCompare

[ Source](https://github.com/andersao/laravel-request-logger)[ Packagist](https://packagist.org/packages/prettus/laravel-request-logger)[ RSS](/packages/prettus-laravel-request-logger/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (4)Versions (5)Used By (1)

Laravel Request Logger
======================

[](#laravel-request-logger)

Request and Response Logger for Laravel

Insiperd by [Morgan - Node HTTP request logger](https://github.com/expressjs/morgan)

[![Latest Stable Version](https://camo.githubusercontent.com/a77387238c620e0c62daa75dc0d7566236698f00bf332eaf9d41cb8dffd09eb6/68747470733a2f2f706f7365722e707567782e6f72672f707265747475732f6c61726176656c2d726571756573742d6c6f676765722f762f737461626c652e737667)](https://packagist.org/packages/prettus/laravel-request-logger) [![Total Downloads](https://camo.githubusercontent.com/cb36b8c3014c268e9066504ad42763897270efbb89a26fcfe028f37f382bb5a6/68747470733a2f2f706f7365722e707567782e6f72672f707265747475732f6c61726176656c2d726571756573742d6c6f676765722f646f776e6c6f6164732e737667)](https://packagist.org/packages/prettus/laravel-request-logger) [![Latest Unstable Version](https://camo.githubusercontent.com/8c9a67ae94ed787eba482f37f7630350a12910949938a9427c4552553c62cfdf/68747470733a2f2f706f7365722e707567782e6f72672f707265747475732f6c61726176656c2d726571756573742d6c6f676765722f762f756e737461626c652e737667)](https://packagist.org/packages/prettus/laravel-request-logger) [![License](https://camo.githubusercontent.com/ad8f4c8694f1fc072df0a1be038b3418579bee00b2d372998508c0d55f4532e2/68747470733a2f2f706f7365722e707567782e6f72672f707265747475732f6c61726176656c2d726571756573742d6c6f676765722f6c6963656e73652e737667)](https://packagist.org/packages/prettus/laravel-request-logger)[![Analytics](https://camo.githubusercontent.com/584f238ba1143d812f26015406f778c1ac024c4dd1dd041341ea20fc5ff5e93e/68747470733a2f2f67612d626561636f6e2e61707073706f742e636f6d2f55412d36313035303734302d312f6c61726176656c2d726571756573742d6c6f676765722f726561646d65)](https://packagist.org/packages/prettus/laravel-request-logger)

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

[](#installation)

### Composer

[](#composer)

Add `prettus/laravel-request-logger` to the "require" section of your `composer.json` file.

```
	"prettus/laravel-request-logger": "1.2.*"
```

Run `composer update` to get the latest version of the package.

or

Run `composer require prettus/laravel-request-logger` direct in your terminal

### Laravel

[](#laravel)

In your `config/app.php` add `Prettus\RequestLogger\Providers\LoggerServiceProvider::class` to the end of the `providers` array:

```
'providers' => array(
    ...,
    Prettus\RequestLogger\Providers\LoggerServiceProvider::class,
),
```

Publish Configuration

```
php artisan vendor:publish --provider="Prettus\RequestLogger\Providers\LoggerServiceProvider"
```

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

[](#configuration)

In your `config/request-logger.php` file, you can change configuration for logger

```
 'logger' => [
    'enabled'   => true,
    'handlers'  => ['Prettus\RequestLogger\Handler\HttpLoggerHandler'],
    'file'      => storage_path("logs/http.log"),
    'level'     => 'info',
    'format'    => 'common'
]
```

PropertyTypeDefault ValueDescriptionenabledbooleantrueEnable or disable log httphandlersarray\['Prettus\\RequestLogger\\Handler\\HttpLoggerHandler'\]Instance of the `Monolog\Handler\HandlerInterface`. (See more)\[\]filestringstorage\_path("logs/http.log")If you are using `Prettus\RequestLogger\Handler\HttpLoggerHandler`, you can set the file will be saved walk logslevelstringinfoLevel logger write: \[notice, info, debug, emergency, alert, critical, error, warning\]formatstringcommonFormat for the log record### Format Interpolation

[](#format-interpolation)

#### Variables

[](#variables)

FormatDescriptionExemple{method}Get the request method.PUT{root}Get the root URL for the application.{url}Get the URL (no query string) for the request.{full-url}Get the full URL for the request.{path}Get the current path info for the request./users{decoded-path}Get the current encoded path info for the request./users{remote-addr}Returns the client IP address.192.168.10.1{format}Gets the format associated with the mime type.html{scheme}Gets the request's scheme.http{port}Returns the port on which the request is made.80{query-string}Generates the normalized query string for the Request.?search=lorem{remote-user}Returns the user.{referer}The page address (if any) by which the user agent to the current page{user-agent}Get user agentMozilla/5.0 (Windows NT 6.3; WOW64){date}Current Date2015-04-05 14:00:00{content}Get the response content.{json:response}{content-length}Get the content length in bytes4863{response-time}Response time in ms231{status}Http status code200{http-version}Http protocol version1.1{server\[*KEY*\]}$\_SERVER Server and execution environment information (See more)\[\]{req\[*HEADER*\]}Request Header values{res\[*HEADER*\]}Response Header values#### Default formats

[](#default-formats)

NameFormatcombined{remote-addr} - {remote-user} \[{date}\] "{method} {url} HTTP/{http-version}" {status} {content-length} "{referer}" "{user-agent}"common{remote-addr} - {remote-user} \[{date}\] "{method} {url} HTTP/{http-version}" {status} {content-length}dev{method} {url} {status} {response-time} ms - {content-length}short{remote-addr} {remote-user} {method} {url} HTTP/{http-version} {status} {content-length} - {response-time} mstiny{method} {url} {status} {content-length} - {response-time} msExamples
--------

[](#examples)

`{method} {full-url}`

```
[2015-04-03 00:00:00] local.INFO: GET http://prettus.local/user/1?param=lorem ["REQUEST"]

```

`{method} {full-url} {remote-addr} {port}`

```
[2015-04-03 00:00:00] local.INFO: GET http://prettus.local/user/1?param=lorem 192.168.10.1 80 ["REQUEST"]

```

`{method} {root} {url} {full-url} {path} {decoded-path} {remote-addr} {format} {scheme} {port} {query-string}`

```
[2015-04-03 00:00:00] local.INFO: GET http://prettus.local http://prettus.local/user/1 http://prettus.local/user/1?param=lorem user/1 user/1 192.168.10.1 html http 80 param=lorem ["REQUEST"]

```

`[{status}] HTTP:{http-version} {content}`

```
[2015-04-03 00:00:00] local.INFO: [200] HTTP:1.1 {"id":1,"name":"Anderson Andrade", "email":"contato@andersonandra.de"} ["RESPONSE"]

```

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity47

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 82% 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 ~508 days

Total

3

Last Release

3090d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/2243981?v=4)[andersonandrade](/maintainers/andersonandrade)[@andersonandrade](https://github.com/andersonandrade)

---

Top Contributors

[![andersao](https://avatars.githubusercontent.com/u/1131667?v=4)](https://github.com/andersao "andersao (41 commits)")[![josemf](https://avatars.githubusercontent.com/u/206655?v=4)](https://github.com/josemf "josemf (7 commits)")[![Omranic](https://avatars.githubusercontent.com/u/406705?v=4)](https://github.com/Omranic "Omranic (1 commits)")[![ozanmuyes](https://avatars.githubusercontent.com/u/1537985?v=4)](https://github.com/ozanmuyes "ozanmuyes (1 commits)")

---

Tags

responserequestlaravellogger

### Embed Badge

![Health badge](/badges/prettus-laravel-request-logger/health.svg)

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45444.2k1](/packages/pressbooks-pressbooks)[api-platform/laravel

API Platform support for Laravel

58171.6k14](/packages/api-platform-laravel)[naoray/laravel-github-monolog

Log driver to store logs as github issues

10823.1k](/packages/naoray-laravel-github-monolog)[onlime/laravel-http-client-global-logger

A global logger for the Laravel HTTP Client

2038.9k](/packages/onlime-laravel-http-client-global-logger)

PHPackages © 2026

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