Download the PHP package san4io/request-logger without Composer

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

Request Logger

Build Status Scrutinizer Code Quality Code Coverage

Package for logging Laravel HTTP requests. By default it uses Monolog with LogStash formatter, but it can be overriden in your ServiceProvider, check Advanced Configuration section.

Installation

You can install the package via composer:

You can publish config

Configuration

In request-logger.php config file you'll find current properties:

Property Default Descirption
storage_path /logs/request-logger.log Where your logs gonna be stored
param_exceptions ['password', 'password_confirmation'] which params should be filtered out from RequestParamsFormatter

Usage

In global middleware:

In group of routes:

In single route:

Default Log Context Formatters

Formatter Name Descirption Example
RequestIPFormatter request_ip Returns request ip information 192.22.22.11
RequestMethodFormatter request_method Returns request method information POST
RequestUriFormatter request_uri Returns request uri information http://localhost/api/v1/authenticate
RequestHeadersFormatter request_headers Returns request headers information {cookie:[Phpstorm-f176c91a=b5df2557-0cd3-44be-857d-7ea59b93c24a; io=Xm-fflHJzYnRSle0AAAB; JSESSIONID.41a4f06a=ux60gwkijzfr1cleylxjci7po;], "origin":["http://localhost"], "accept":["application/json"]}
RequestParamsFormatter request_params Returns request params(filtered) information {"email":"qwe"}
ResponseBenchmarkFormatter response_ms Returns execution time 0.1858180046081543
ResponseContentFormatter response_content Return response content(can be very heavy, use wisely) {\"message\":\"The given data was invalid.\",\"errors\":{\"email\":[\"The email must be a valid email address.\"]}}

Extending

You can extend your Logger with your own ContextFormatters.

Your context formatter should extend \San4io\RequestLogger\Contracts\ContextFormatterContract interface. In format method should return your desired output. In name method, you should return unique name of formatter

Advanced Configuration

Overriding Logger

You can override logger in your ServiceProvider by binding your logger to 'app.request.logger' For example you want other Formatter like MongoDBFormatter.

That's it, you have setted logger with your desired formatter.

Or you can create your own logger with different name, and inject it to RequestLogger for example:

Overriding LogContextFormatter

It is possible that you need some addidtional data to be returned to your log. In this case you extend \San4io\RequestLogger\Contracts\ContextFormatterContract interface (check Extending section) and adding it to LogContextFormatter. Example:

Road map

Contribution

Any contributions welcome!

Log Examples


All versions of request-logger with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1
laravel/framework Version 5.5.*
monolog/monolog Version ~1.12
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 san4io/request-logger contains the following files

Loading the files please wait ....