Download the PHP package dniccum/laravel-request-logs without Composer

On this page you can find all versions of the php package dniccum/laravel-request-logs. 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-logs

Laravel Request Logs

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

Provide insight to your application's requests with this Laravel-specific package. Simply add a light-weight middleware to your application and capture all the requests' body, headers, and responses. A console command is also provided that can be used to purge the logs to prevent any dated, unwanted bloat.

Installation

You can install the package via composer:

You can publish and run the migrations with:

You can publish the config file with:

This is the contents of the published config file:

Usage

Middleware

Adding to Middleware Groups

If you would like to use this package's middleware across a large group of requests, like all of your api routes, you can apply it to your applications api middleware group within your app/Http/Kernel.php like so:

Adding to specific routes

On the other hand, if you are wanting to add some logging clarity to specific routes, you can define it as a route middleware within your app/Http/Kernel.php:

and then assign it to a specific route within your routes file:

IMPORTANT: Response Body Length Limit

Assuming that your database migration and model are unchanged, there is currently logic in place that will prevent the response_body column from being overloaded. What does this mean? In the event that the response body of the request that you are logging is very large (ie returning 500+ results from an API), the number of bytes/characters might be too large for the database to store without failing. If the response body is longer than 65,000 characters, the response body will NOT be saved.

Log Cleanup (optional)

Note – this is not required but HIGHLY recommended as this could lead to large amounts of data within your database in short periods of time.

To automate the removal of older logs you can either use the provided artisan command php artisan request-logs:clean manually with your app's environment, or you can leverage your app's scheduler process within your app/Console/Kernel.php file to automate it like so:

Stored History

By default, this package will retain 21 days of logs. This can be changed via environment variable (LOGGING_HISTORY) or simply modifying it within the request-logs.php configuration file.

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of laravel-request-logs with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0|^8.1|^8.2
laravel/framework Version ^8.0|^9.0|^10.0
spatie/laravel-package-tools Version ^1.13.0
illuminate/contracts Version ^9.0|^10.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 dniccum/laravel-request-logs contains the following files

Loading the files please wait ....