2017 © Pedro Peláez
 

library laravel-request-logger

A Laravel 5 package to log HTTP requests

image

bwt-team/laravel-request-logger

A Laravel 5 package to log HTTP requests

  • Thursday, June 28, 2018
  • by BWT group
  • Repository
  • 0 Watchers
  • 1 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 133 % Grown

The README.md

English description | Russian description , (*1)

Laravel 5 Request Logger

Latest Stable Version ![Latest Unstable Version][ico-unstable-version] License, (*2)

This package provides quick and easy setup for the requests logging., (*3)

This package requires Laravel 5.6+

Contents

Installation

This package can be installed via composer with this command:, (*4)

composer require bwt-team/laravel-request-logger

Set up

Laravel 5.6+ uses package auto-discovery, so there's no need to register the service provider manually. If auto-discovery is disabled the service provider can be registered by adding these records into providers array in config/app.php file:, (*5)

BwtTeam\LaravelRequestLogger\Providers\RequestLoggerServiceProvider::class

This service provider will register the middleware that calls the logging itself and will allow configuring all the settings required for the package installation. To use a facade add this record to the aliases array:, (*6)

'RequestLogger' => \BwtTeam\LaravelRequestLogger\Facades\RequestLogger::class,

IMPORTANT! By default, logging is disabled in the settings. This allows to configure the package after the installation and enable the logging once everything is ready. To activate the logging use an environment variable "RL_ENABLE". Alternatively, once the config file has been published, it is possible to describe a function that will activate the logging only for the requests of interest.

Here's an example of the function that describes the logging conditions:, (*7)

'enabled' => function(\Illuminate\Http\Request $request) {
    return $request->isMethod('GET');
},

In order to publish the config file execute next command:, (*8)

php artisan vendor:publish --provider="BwtTeam\LaravelRequestLogger\Providers\RequestLoggerServiceProvider" --tag=config

Next options are available in the settings: - enable/disable logging; - titles of the fields that should be excluded from the logs (for example, "password"); - options for type casting and logs optimization; - logs storage settings., (*9)

The default log storage is "database". For this storage to work correctly it is necessary to execute a migration to create a table for logs. In order to publish this migration execute this command:, (*10)

php artisan request-logger:table

It is possible to write custom data. To do this, the data should be passed to "put" method of "BwtTeam\LaravelRequestLogger\RequestLoggerRepository" class. For example:, (*11)

app(\BwtTeam\LaravelRequestLogger\RepositoryInterface::class)->put('test', ['some', 'data']);

Alternatively, a facade could be used:, (*12)

\RequestLogger::put('test', ['some', 'data']);

License

This package uses MIT., (*13)

The Versions

28/06 2018

dev-master

9999999-dev

A Laravel 5 package to log HTTP requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chesanovskiy Denis

laravel logger logging logs

28/06 2018

dev-develop

dev-develop

A Laravel 5 package to log HTTP requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chesanovskiy Denis

laravel logger logging logs

28/06 2018

v1.0.0

1.0.0.0

A Laravel 5 package to log HTTP requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chesanovskiy Denis

laravel logger logging logs

24/05 2018

v1.0.1

1.0.1.0

A Laravel 5 package to log HTTP requests

  Sources   Download

MIT

The Requires

 

The Development Requires

by Chesanovskiy Denis

laravel logger logging logs