PackageTrack
Sign in Get early access

gmponos/guzzle_logger

A Guzzle middleware to log request and responses automatically

v2.2.0 2.3M downloads/mo #4940 most downloaded on Packagist gmponos/guzzle-log-middleware

What this package is like to depend on

Last release 4 years ago

no release in 18 months

Ships unpredictably

gaps range from 2 weeks to 1.7 years

Nearly every release is documented

notes for 13 of 14 stable releases

Nothing withdrawn

no release was ever pulled

10 years old

14 releases · first in 2016

0 releases in the last 12 months

see the full history below

Release timeline

14 releases · Apr 2016 to Apr 2022
2017 2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release

Releases

latest 14
  1. v2.2.0 04 Apr 2022

    Nothing published for this version

  2. v2.1.0 18 Mar 2022
    Release notes

    Changes

    • Allow PHP 8
    • Fix a deprecation on MultiRecordArrayHandler regarding query
    Open source →
    Release notes

    That was a long layoff

    Open source →
  3. v2.0.0 05 Jul 2020
    Release notes

    Changed

    • [BC] Changed the signature of HandlerInterface::log to allow Throwables. Now the signature is
    HandlerInterface::log(
        LoggerInterface $logger,
        RequestInterface $request,
        ?ResponseInterface $response = null,
        ?Throwable $exception = null,
        ?TransferStats $stats = null,
        array $options = []
    )
    • Allow guzzle 7
    Open source →
    Release notes

    Changed

    • [BC] Changed the signature of HandlerInterface::log to allow Throwables. Now the signature is
    HandlerInterface::log(
        LoggerInterface $logger,
        RequestInterface $request,
        ?ResponseInterface $response = null,
        ?Throwable $exception = null,
        ?TransferStats $stats = null,
        array $options = []
    )
    
    • Allow guzzle 7
    Open source →
  4. v1.1.0 03 Sep 2019
    Release notes

    Added

    • Added parameters in MultiRecordArrayHandler in order to customize the size truncated #25
    • MultiRecordArrayHandler will parse form requests as and log them as array #27
    Open source →
    Release notes

    Added

    • Added parameters in MultiRecordArrayHandler in order to customize the size truncated #25
    • MultiRecordArrayHandler will parse form requests as and log them as array #27
    Open source →
  5. v1.0.1 18 Jun 2019
    Release notes

    Changes

    • Fixes #24. Body MUST rewind on huge responses.
    Open source →
    Release notes

    Changes

    • Fixes #24. Body MUST rewind on huge responses.
    Open source →
  6. v1.0.0 28 Dec 2018
    Release notes

    Changes

    • Added more classes of status codes to ThresholdStrategy
    Open source →
  7. v0.8.0 13 Dec 2018
    Release notes

    Changes

    • Set as the default strategy in all handlers the FixedStrategy

    BREAKING CHANGES

    • LogLevelStrategy class is removed and it has been separated to smaller classes.
      Check the added section below.
    • Changed the namespaces completely. The new Namespace is GuzzleLogMiddleware instead of Gmponos\GuzzleLogger.
      Check the README file for instructions.
    • Changed the signature of function HandlerInterface::log.
    • Changed ArrayHandler to MultiRecordArrayHandler

    Added

    • FixedStrategy a strategy that you are able to set one level for all your logs.
    • ThresholdLevelStrategy a strategy that works with thresholds depending on the status code.
    • StatusCodeStrategy a strategy that you are able to set a specific log level per status code.
    Open source →
    Release notes

    Changes

    • Set as the default strategy in all handlers the FixedStrategy

    BREAKING CHANGES

    • LogLevelStrategy class is removed and it has been separated to smaller classes. Check the added section below.
    • Changed the namespaces completely. The new namespace is GuzzleLogMiddleware instead of Gmponos\GuzzleLogger. Check the README file for instructions.
    • Changed the signature of function HandlerInterface::log.
    • Changed ArrayHandler to MultiRecordArrayHandler

    Added

    • FixedStrategy a strategy that you are able to set one level for all your logs.
    • ThresholdLevelStrategy a strategy that works with thresholds depending on the status code.
    • StatusCodeStrategy a strategy that you are able to set a specific log level per status code.
    Open source →
  8. v0.7.0 31 Oct 2018
    Release notes

    Changed

    • BREAKING CHANGE Dropped support for PHP 5 and require PHP 7.2 as minimum version.
    Open source →
    Release notes

    Changed

    • BREAKING CHANGE Dropped support for PHP 5 and require PHP 7.2 as minimum version.
    Open source →
  9. v0.6.0 19 Oct 2018
    Release notes

    Changed

    • BREAKING CHANGE Changed the constructor function of middleware. From now on you can pass a handler to it's constructor. Handlers are responsible for logging request/responses. Removed threshold argument.
    Open source →
    Release notes

    Changed

    • BREAKING CHANGE Changed the constructor function of middleware.
      • From now on you can pass a handler to it's constructor. Handlers are responsible for logging request/responses.
      • Removed threshold argument.
    Open source →
  10. v0.5.0 01 Oct 2018
    Release notes

    Changed

    • BREAKING CHANGE Renamed the variable $logRequestOnExceptionOnly to $onExceptionOnly. The purpose of this constructor argument was to log request and responses only if an exceptgition occurs. If you were manually setting this argument as true now you must set it as false as the variables meaning is inverted.
    • Deprecated the option requests. It will be removed on my next version.
    Open source →
    Release notes

    Changed

    • BREAKING CHANGE Renamed the variable $logRequestOnExceptionOnly to $onExceptionOnly. The purpose of this constructor argument was to log request and responses only if an exception occurs. If you were manually setting this argument as true now you must set it as false as the variables meaning is inverted.
    • Deprecated the option requests. It will be removed on my next version.
    Open source →
  11. v0.4.0 12 Sep 2018
    Release notes

    Changed

    • Removed LoggerAwareTrait. Therefore the logger can not be set after the construction of the middleware.
    • Changed the variable name $logRequests of the constructor to $logRequestOnExceptionOnly.
    • In case a message is not an \Exception or a MessageInterface an Exception is thrown.
    • Changed all the functions except of __construct and __invoke to private. Same for the properties.
    Open source →
  12. v0.3.0 23 Aug 2018
    Release notes

    Changed

    • The package was reading the headers of the Request/Response and if they contained application/json the body was parsed into an array in order to be better readable in the logger. This has changed to match a regular expression /application\/[\w\.\+]*(json)/ in order to catch more cases. Thanks @eduarguzher #4
    • According to PHPStorm indication the ext-json needs to be installed in order for the package to work. Therefore it was added as a requirement to composer.json
    Open source →
  13. v0.2.0 24 Jun 2018
    Release notes

    Added

    • A new option is added with key sensitive. When you make a request using guzzle you can set this option to true in order not to log the body of the request and response. Example:
    $guzzle->get('/test', ['log' => ['sensitive' => true]]); 
    

    Changed

    • Changed the required version of guzzle from ^6.3 to 6.*. Package should be able to work with any version 6.* of guzzle.
    • For performance reasons when a body of a request/response is bigger than 3500 characters the body is truncated. When it was truncated a key with summary was added in the logs and also a key with body. The body contained only the wording "Body was truncated because of it's size". This is changed now and the summary key is removed and the body key will contain the summary from now on.
    • If a Stream is not seekable or readable the body can not be logged. A wording is added instead in the key body.
    Open source →
  14. v0.1.0 05 Apr 2016
    Release notes

    Added

    • Created the first functionality of the middleware
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive