Download the PHP package mxnwire/laravel-request-id without Composer

On this page you can find all versions of the php package mxnwire/laravel-request-id. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-request-id

Laravel Request ID

Propagate request, session and correlation IDs across the request lifecycle: read them from incoming headers, echo them on the response, and attach them (plus the authenticated user) to every log record.

Only valid UUID v4 values are accepted from upstream; anything else is treated as absent (and regenerated for request_id).

Installation

The service provider is auto-discovered. By default the middleware is prepended to the global HTTP stack, so every request is covered with no further setup.

Configuration

Publish the config to customise behaviour:

Key options in config/request-id.php:

Manual middleware registration

Set register_global_middleware to false, then apply the alias where needed:

Reading the IDs

Logging

When log is enabled the IDs (and, when log_user is on, the authenticated-user fields) are attached to every log record by a Monolog processor. The processor is always pushed to the default log driver, plus any channels listed in log_channels.

Where the fields land on the record is controlled by log_destination:

JSON log channel (preferred)

For anything beyond local debugging, a JSON-formatted channel paired with log_destination => 'extra' is the recommended setup. It keeps the tracing metadata in its own namespace, cleanly separated from the request payload and trivially queryable by your log aggregator:

Point a channel at Monolog's JsonFormatter in config/logging.php:

then set log_destination => 'extra' and add the channel to log_channels so the processor is attached to it.

With a plain LineFormatter (e.g. the stock single/daily channels), leave log_destination as 'context' so the IDs read as part of the main entry.

Testing

License

MIT


All versions of laravel-request-id with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
illuminate/support Version ^8.0|^9.0|^10.0|^11.0
illuminate/http Version ^8.0|^9.0|^10.0|^11.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mxnwire/laravel-request-id contains the following files

Loading the files please wait ...