Search by

techweb-sk / techweb-logger-extension

info@techweb.sk

Tags every log record a Laravel request writes with the request behind it, so Central Logger can tie an error to its exact request. Install and nothing else.

Package info

github.com/techweb-sk/techweb-logger-extension

pkg:composer/techweb-sk/techweb-logger-extension

Statistics

Installs: 28

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.0 2026-09-08 08:36 UTC

This package is auto-updated.

Last update: 2026-09-08 08:54:19 UTC


README

Tags every log record a Laravel request writes with the request behind it, so Central Logger can tie an error to the exact request that caused it — the way Telescope shows a request beside an exception, but from the log file the application already writes.

Install, and nothing else

composer require techweb-sk/techweb-logger-extension

That is the whole setup. Package discovery loads the service provider, which adds one middleware to the web and api groups. There is no config to publish, nothing to add to the kernel or to bootstrap/app.php, and nothing in .env.

What it writes

One extra key, req, in the context of every record written during a request, including the exception handler's report of an uncaught exception and a fatal error caught at shutdown:

[2026-09-08 09:00:12] production.ERROR: Maximum execution time of 60 seconds exceeded {"exception":"[object] (...)","req":"GET https://www.example.com/foodbloger/19439?page=2 ip=193.70.34.35 user=42 route=foodbloger.show"}

Method, full URL, client address, the signed-in user's id when there is one, and the route name. The value is one flat string on purpose: Central Logger's parser lifts it out of the line whatever the exception beside it looks like.

What it never writes

Request bodies and headers, which is where passwords and tokens live. Query values whose name looks like a secret (password, token, key, auth, signature, session, cookie) are masked. URLs are cut at 500 characters.

Console commands and queue jobs have no request and get nothing.

Requirements

PHP 8.1 or later, Laravel 9.21 or later. On Laravel 9.21+ the context reaches every log channel; on older 9.x releases it reaches the default channel, which is where the exception handler writes anyway.

Tests

composer install
composer test