Created
June 6, 2017 19:54
-
-
Save tayhimself/7f4713c3f207cdd2ba3d771c85cbf5dc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$monologHandler = new Monolog\Logger( | |
'Logger', | |
array( | |
new Monolog\Handler\StreamHandler('/tmp/log.txt', Monolog\Logger::DEBUG) | |
) | |
); | |
$stack = GuzzleHttp\HandlerStack::create(); | |
$stack->push( | |
GuzzleHttp\Middleware::log( | |
$monologHandler, | |
new GuzzleHttp\MessageFormatter('{req_body} - {res_body}') | |
) | |
); | |
$guzzleClient = new \GuzzleHttp\Client( | |
array('handler' => $stack) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment