Download the PHP package gmponos/guzzle_logger without Composer

On this page you can find all versions of the php package gmponos/guzzle_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 guzzle_logger

Guzzle Log Middleware

codecov Total Downloads Build Status MIT licensed

This is a middleware for guzzle that will help you automatically log every request and response using a PSR-3 logger.

The middleware is functional with version 6 of Guzzle.

Install

Via Composer

Usage

Simple usage

From now on each request and response you execute using $client object will be logged. By default the middleware logs every activity with level DEBUG.

Advanced initialization

The signature of the LogMiddleware class is the following:

Handlers

In order to make the middleware more flexible we allow the developer to initialize it with a handler. A handler is the class that will be responsible for logging the HTTP message and it must implement a HandlerInterface.

As an example let's say that we create the following handler:

We can pass the handler above during construction of the middleware.

From now on all Requests will be logged. Note that at the example above only requests are logged.

Important

If no handler is passed the middleware will initialize it's own handler. At the moment the default one is MultiRecordArrayHandler

MultiRecordArrayHandler

This is the default handler used from the middleware. This handler uses internally the FixedStrategy and logs all request and responses with level debug. This handler adds a separate log entry for each Request, Response, Exception or TransferStats. The information about each object are added as a context array to the log entry.

StringHandler

This handler uses internally the FixedStrategy and logs all request and responses with level debug. You can initialize this handler with a custom strategy. This handler adds a separate log entry for each Request, Response, Exception or TransferStats. The handler converts the objects to strings and the information about each object are added to the message of the log entry.

Log Level Strategies

Strategies are used to define the LogLevel that the handler will use to log each object.

FixedStrategy

You can use this strategy to log each HTTP Message with a specific level.

StatusCodeStrategy

You can use this strategy to log each HTTP Response with a specific level depending on the status code of the Response.

Using options on each request

You can set on each request options about your log.

Change log

Please see CHANGELOG for more information what has changed recently.

Testing

Credits

License

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


All versions of guzzle_logger with dependencies

PHP Build Version
Package Version
Requires php Version ^7.2 || ^8.0
ext-json Version *
guzzlehttp/guzzle Version ^6.1 || ^7.0.1
guzzlehttp/psr7 Version ^1.7 || ^2.0
psr/log Version ^1.1 || ^2.0 || ^3.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 gmponos/guzzle_logger contains the following files

Loading the files please wait ....