- Is hostme/request-id-bundle a Laravel package?
- No. It is a Symfony bundle that registers a kernel event listener and service container wiring, so it will not boot inside a Laravel application. Laravel's middleware pipeline, container, and logging channels are different abstractions entirely. Treat it as a reference implementation of the request-ID pattern rather than a Composer dependency for a Laravel stack.
- How do I install hostme/request-id-bundle?
- In a Symfony service, add it with composer require hostme/request-id-bundle and enable the bundle in config/bundles.php; the listener is then registered through the container automatically. There is no supported installation path for Laravel. Porting the listener semantics into a global middleware is the realistic option there.
- Can I use hostme/request-id-bundle in Laravel 10 or 11?
- Not practically. Pulling in symfony/http-kernel, symfony/dependency-injection, and the Monolog bridge just to boot an event listener Laravel never dispatches adds dependency surface for no benefit. The equivalent Laravel implementation is a small global middleware plus Log::withContext, roughly a one-to-two-day task that you fully own.
- How do I add a request ID to Laravel logs without this bundle?
- Write a global middleware that reads an inbound X-Request-Id or mints a UUID, then calls Log::withContext so every log record carries the value. Forward the same ID on outbound calls with Http::withHeaders and pass it into queued job payloads. About 80 to 120 lines covers the whole pattern with no third-party dependency.
- Does the bundle validate client-supplied X-Request-Id headers?
- The documented feature set covers generating an ID, exposing a configurable response header, and container integration; there is no stated validation of inbound values. Trusting an attacker-chosen ID blindly opens log injection and trace-forgery vectors. Whatever implementation you use, enforce a length limit, a strict charset, and ideally a UUID format before accepting a header from the client.
- Which Symfony and Monolog versions does hostme/request-id-bundle support?
- Its releases date to early 2023 and are pinned to the Symfony and Monolog majors current at that time. Check the composer.json constraints against your own support matrix before adopting it. Expect the version ceiling to drift out of supported ranges within one or two upgrade cycles, particularly around Monolog 2 versus 3 processor APIs.
- Does a request ID give me distributed tracing?
- No. A request ID is a join key, not a trace: it correlates log lines belonging to one request but records no spans, timing, or parent-child relationships. Teams frequently adopt this and assume observability they do not actually have. If you need end-to-end tracing, OpenTelemetry with traceparent propagation is the correct answer.
- Does the request ID propagate to queued jobs and console commands?
- The bundle targets Symfony HTTP requests via a kernel listener, so async boundaries fall outside its scope unless you propagate the ID yourself. Laravel queue workers, console commands, cron tasks, and message consumers all need explicit context decoration. Verify propagation across each of those boundaries before you rely on the ID for correlation.
- Is hostme/request-id-bundle actively maintained and safe for production?
- It has roughly three stars, zero dependents, a last release in March 2023, and no visible CI or security policy, which reads as a single-vendor internal utility published publicly. Adopting it means accepting maintainer risk. If you must use it, fork it into your own VCS, pin the commit, and add a PHP version constraint test so you own the upgrade path deliberately.
- What is the best alternative for request correlation in Laravel?
- A first-party middleware is the pragmatic choice: read or mint the ID, register it with Log::withContext, and forward it through Http::withHeaders and queue payloads. Standardize the contract - header name, format, and propagation rules - across services rather than standardizing on a library. Graduate to OpenTelemetry when you genuinely need tracing rather than log correlation.