Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Laravel Request Logger Laravel Package

bilfeldt/laravel-request-logger

Log incoming HTTP requests in Laravel with a simple middleware. Capture method, URL, headers, payload, response status and timing, then store to database or logs for debugging, auditing and performance insights. Configurable, lightweight, easy to add to routes or globally.

View on GitHub
Deep Wiki
Context7
Upgrade

2.* => 3.*

  • Because the package now supports both Correlation-ID and Request-ID then two new database columns needs to be inserted into the request_logs table. See the table migration stub for the required changes.
  • The function aggregate($request, $response, $date) has been removed from the RequestLog model. If you are using this function instead then use the bilfeldt/laravel-route-statistics package for aggregated statistical logging if needed.
  • The config log_context has been removed. If you are using this config to add Log context, then apply the LogContextMiddleware from the now required package bilfeldt/laravel-correlation-id package for the relevant routes.
  • The config header has been removed. If you are using this config to add the unique request id to the response in the Request-ID headerm then do so using your own middleware, or consider (recommended) to instead set the Correlation-ID header using the CorrelationIdMiddleware from the now required package bilfeldt/laravel-correlation-id package for the relevant routes.

1.* => 2.*

No breaking changes. The only changes are to the development dependencies used for testing and then the minimum Laravel and PHP requirements.

Changes

Unreleased

  • Add request-logger.connection config option (controlled by the REQUEST_LOGGER_DB_CONNECTION env var) so the RequestLog model and its migration can be stored in a dedicated database connection separate from the main application data.
  • Fix: HTTP header filters are now matched case-insensitively. The default Authorization filter never matched because Symfony's HeaderBag lowercases header names while Arr::get is case-sensitive — Bearer tokens were silently written to the log. Header filtering now lowercases both sides; payload filtering remains case-sensitive (JSON keys are case-sensitive per spec).
  • Fix: Malformed UTF-8 in request data no longer crashes logging. The payload, headers and response_body attributes are cast to JSON, and json_encode() throws JsonEncodingException ("Malformed UTF-8 characters") when a request contains invalid byte sequences — commonly from malformed or malicious requests (e.g. CVE-2024-4577 php-cgi.exe scanner probes) — aborting the request as the log row is saved. Logged strings are now scrubbed to valid UTF-8 before encoding.

3.8.0 - 2026-03-06

  • Add Laravel 13 support

3.7.0 - 2025-11-28

  • Add PHP 8.5 support

3.6.0 - 2025-02-17

  • Add Laravel 12 support

3.5.0 - 2025-02-11

  • Move registration of event listeners to the main service provider and remove the dedicated EventServiceProvider.

3.4.0 - 2024-12-04

  • Add PHP 8.4 support

3.3.0 - 2024-05-07

  • Add config for which model to use in the RequestLog models user() relationship

3.2.0

  • Add Laravel 11 compatibility

3.1.0

  • Add PHP 8.3 compatibility

3.0.0

  • Rely on the bilfeldt/laravel-correlation-id package for request and response headers and unique id.
  • Log both Correlation-ID header and the unique Request ID.
  • Remove dependency on spatie/laravel-package-tools
  • Require PHP 8.2

2.2.0 - 2023-08-29

  • Add middleware for adding 'Correlation-ID' header to responses

2.1.0 - 2023-07-24

  • Add support for PHP 8.1

2.0.0 - 2023-05-01

  • Add support for PHP 8.2
  • Minimum PHP requirement 8.2
  • Add support for Laravel 10.*
  • Minimum Laravel requirement 10.0

v1.1.0 - 2022-01-28

  • Add Laravel 9 support
  • Add PHP 8.1 support

v1.0.2 - 2022-01-11

  • Exclude the parameter api_token per default from all logs (added to config) #17

v1.0.1 - 2021-11-15

  • Fix issue when route is undefined: By @woenel in #15

1.0.0 - 2021-11-12

  • initial release
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor