hutsoliak/laravel-http-logger

Laravel http requests logger

1.0.5 2024-04-06 11:56 UTC

This package is auto-updated.

Last update: 2025-06-07 09:16:10 UTC


README

Laravel Http Logger is a package that help you to log and see incoming requests to you server and outgoing.

It includes values:

  • Request method
  • Get/Post request variables
  • Response data
  • Headers
  • Cookies
  • Process time (ms)
  • Current user id (if exists)
  • Datetime of request

This package also logs all outgoing requests you can make with Laravel HTTP Client. It includes the same values as for incoming requests (Request method, Get/Post request variables, ets... )

Instalation guide

Install the package via composer

composer require hutsoliak/laravel-http-logger

Migrations

You need to run migration for logs_http table

php artisan migrate

Add variable to config/services.php config

The package enabled by default for local environment app()->environment('local').

The package can be easily enabled/disabled in config.

You can exclude some urls you don't want to log

return [
    ...
    'http_logger' => [
        'enabled' => true,
        'ignoreUrls' => [
            '^/admin/.+$', // regexp
            '^/admin/login',
        ],
    ]
];

Contributing

Thank you for considering contributing to Laravel Http Logger! You can read the contribution guide here.

License

Laravel Http Logger is open-sourced software licensed under the MIT license.