https://github.com/nixilla/api-logger-bundle
API logger bundle help your app with API calls monitoring
https://github.com/nixilla/api-logger-bundle
api-logger symfony-bundle symfony-toolbar-extension
Last synced: 5 months ago
JSON representation
API logger bundle help your app with API calls monitoring
- Host: GitHub
- URL: https://github.com/nixilla/api-logger-bundle
- Owner: nixilla
- Created: 2013-09-09T15:50:22.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2021-03-29T10:39:05.000Z (about 4 years ago)
- Last Synced: 2024-11-15T22:00:51.547Z (6 months ago)
- Topics: api-logger, symfony-bundle, symfony-toolbar-extension
- Language: PHP
- Size: 73.2 KB
- Stars: 4
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# API Logger Bundle
[](https://packagist.org/packages/nixilla/api-logger-bundle)
[](https://travis-ci.org/nixilla/api-logger-bundle)
[](https://coveralls.io/github/nixilla/api-logger-bundle?branch=develop)
[](https://scrutinizer-ci.com/g/nixilla/api-logger-bundle/?branch=develop)
[](https://packagist.org/packages/nixilla/api-logger-bundle)## Versions
For `buzz<0.16` please use `nixilla/api-logger-bundle:^0.4` and for latest `buzz:^1`, use `nixilla/api-logger-bundle:^0.5.1`
## Installation
Step 1: composer
```bash
composer require nixilla/api-logger-bundle
```Step 2: enable bundle by adding it to AppKernel
```php
getEnvironment(), array('dev', 'test'))) {
// your other dev bundles here
$bundles[] = new Nixilla\Api\LoggerBundle\NixillaApiLoggerBundle();
}```
Step 3: configuration
For latest buzz all you need to do is add this line into `config/packages/buzz.yml`
```yaml
services:
Buzz\Browser:
arguments: ['@Buzz\Client\BuzzClientInterface', '@Psr\Http\Message\RequestFactoryInterface']
calls:
# other middleware classes here
- ['addMiddleware', ['@Nixilla\Api\LoggerBundle\Middleware\ApiLoggerMiddleware']]
```For earlier version of buzz <0.16 and earlier version of this bundle <0.5 you need to configure like this:
If you're use HWIOAuthBundle and you want to monitor all OAuth API calls, you can now override default
`hwi_oauth.http_client` service used by this bundle by adding this few lines to your `config_dev.yml` file```yaml
# app/config/config_dev.yml
imports:
- { resource: config.yml }parameters:
buzz.client.class: Nixilla\Api\LoggerBundle\Proxy\Buzz\Client\Curlservices:
hwi_oauth.http_client:
class: "%buzz.client.class%"
calls:
- [ "setLogger", [ "@nixilla.api.logger" ] ]
```If you're using `sensio/buzz-bundle`, you may want to override the `buzz.client` in config_dev.yml
```yaml
# app/config/config_dev.yml
imports:
- { resource: config.yml }parameters:
buzz.client.class: Nixilla\Api\LoggerBundle\Proxy\Buzz\Client\Curlservices:
buzz.client:
class: "%buzz.client.class%"
calls:
- [ "setTimeout", [ "%buzz.client.timeout%" ] ]
- [ "setLogger", [ "@nixilla.api.logger" ] ]
```If you're using `twilio/sdk` you may want to override their Http Client in config_dev.yml
```yaml
# app/config/config_dev.yml
imports:
- { resource: config.yml }services:
twilio.http.client:
class: Nixilla\Api\LoggerBundle\Proxy\Twilio\CurlClient
calls:
- [ "setLogger", [ "@nixilla.api.logger" ] ]
twilio.rest.client:
class: Twilio\Rest\Client
arguments: [ "%twilio.username%", "%twilio.password%", ~, ~, '@twilio.http.client']```