Download the PHP package landrok/laravel-request-logger without Composer
On this page you can find all versions of the php package landrok/laravel-request-logger. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download landrok/laravel-request-logger
More information about landrok/laravel-request-logger
Files in landrok/laravel-request-logger
Package laravel-request-logger
Short Description A Laravel middleware to log HTTP requests into database.
License MIT
Homepage https://github.com/landrok/laravel-request-logger
Informations about the package laravel-request-logger
Laravel Request Logger
Laravel Request Logger provides a middleware that logs HTTP requests into a table.
It can be reconfigured to target specific requests or to log only specified informations.
What is logged ?
For each request, the following informations are stored.
User
- session_id
- user_id
- ip
- route
- route_params: optional
Performances
- duration
- mem_alloc
HTTP stuff
- method
- status_code
- url: this one has 2 ways of configuration: set it to
full
to log full URL with query or set it totrue
to log only URL - referer
- referer_host
- request_headers: optional
- response_headers: optional
Device
The following values are provided by the jenssegers/agent
package.
- device
- os
- os_version
- browser
- browser_version
- is_desktop
- is_mobile
- is_tablet
- is_phone
- is_robot
- robot_name
- user_agent
Miscellaneous
- meta : this field is for custom logging. See RequestLogger::meta($value)
- created_at
Table of contents
- Requirements
- Installation
- Configuration
- Contributing
- License
Requirements
Laravel Request Logger supports Laravel 6, 7, 8.
Installation
Create the request_logs
table with
Configuration
You may log every calls (default), only routes that match some patterns and only specified criterias.
You have to publish configuration file before.
php artisan vendor:publish --provider="Landrok\Laravel\RequestLogger\RequestLoggerServiceProvider"
The config file can be found at config/requestlogger.php
.
Meta::set(string $key, $value)
This tool is made to log anything from anywhere in your code
(Controller, View, Service, etc...) into the meta
column.
$value
can be a string or an array or a serializable. It will be
stored as a JSON string.
Before using this method, you have to authorize this field in the config file.
Contributing
Feel free to open issues and make PR. Contributions are welcome.
License
Laravel Request License is licensed under The MIT License (MIT).