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.
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.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.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.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.No breaking changes. The only changes are to the development dependencies used for testing and then the minimum Laravel and PHP requirements.
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.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).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.RequestLog models user() relationshipbilfeldt/laravel-correlation-id package for request and response headers and unique id.Correlation-ID header and the unique Request ID.spatie/laravel-package-toolsHow can I help you explore Laravel packages today?