Log HTTP requests and responses for Hyperf.

v1.0.0 2021-05-11 09:38 UTC

This package is auto-updated.

Last update: 2022-06-30 06:32:33 UTC


A middleware which can log incoming requests and responses to the log.


Require the gokure/hypref-http-logger package in your composer.json and update your dependencies:

composer require gokure/hypref-http-logger

Optionally you can publish the configuration file with:

php bin/hyperf.php vendor:publish gokure/hypref-http-logger


To allow HTTP Logger in your application, add the HttpLoggerMiddleware middleware at the top of the property of config/autoload/middlewares.php file in the config (see Configuration below):

'http' => [

Also, to allow HTTP Logger for exception responses, you need add the HttpLoggerExceptionHandler handler at the bottom of the property of config/autoload/exceptions.php file:

'handler' => [
    'http' => [

Note: No response logged, if $this->stopPropagation() is used in the previous exception handlers.


  • To filter secret body of requests and responses.
  • Add test cases.


Released under the MIT License, see LICENSE.