2017 © Pedro Peláez
 

symfony-bundle pinkfire-bundle

Debug application using Pinkfire

image

pinkfire/pinkfire-bundle

Debug application using Pinkfire

  • Wednesday, January 4, 2017
  • by iamluc
  • Repository
  • 3 Watchers
  • 9 Stars
  • 10,032 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 10 Versions
  • 10 % Grown

The README.md

PinkfireBundle

Symfony bundle to integrate support of Pinkfire., (*1)

Pinkfire is a great tool to help debugging SOA (Service Oriented Architecture) by centralizing logs., (*2)

Install

Add the bundle to your composer.json

composer.phar require "pinkfire/pinkfire-bundle"

Update your app/AppKernel.php

``` php <?php //... if (in_array($this->getEnvironment(), array('dev', 'test'))) { //... $bundles[] = new Pinkfire\PinkfireBundle\PinkfireBundle(); }, (*3)


### Update your config (`app/config/config_dev.yml`) ``` yaml pinkfire: application : "my-application" # required host: "localhost" # Optional port: 3000 # Optional log_max_length: -1 # Optional, max length of read input data url_blacklist: [ ] # Optional, array of URIs patterns to ignore url_debug: [ "_.*" ] # Optional, array of URIs patterns to mark as debug log_level: warning # Optional, log level used by the Monolog handler enabled: true # optional, allow to disable the request/response listener

About enabled: This bundle will not throw exception or crash if it can connect the the pinkfire host. But it adds a small overhead. So if your pinkfire server is not running and you care about performance, you should disable it., (*4)

Test it

Open pinkfire in you browser then visit your website (in dev environment). You should see all master requests !, (*5)

Go further

Monolog

You can forward your logs to pinkfire by updating your monolog config in file app/config/config_dev.yml, (*6)

``` yaml monolog: handlers: pinkfire: type: service id: pinkfire.monolog_handler, (*7)


### Guzzle With Guzzle 6 (and `csa/guzzle-bundle`), a middleware is automatically registered to add the Pinkfire headers (path and channel) to every requests. With older version of Guzzle, use our Guzzle subscriber ```php $client = new GuzzleHttp\Client(); $emitter = $client->getEmitter(); $emitter->attach($this->get('pinkfire.guzzle_subscriber'));

Buzz

A bridge is available to interact with Buzz., (*8)

The easiest way is to attach the pinkfire.buzz_listener service to a Buzz\Browser. If you use a Buzz\Client and not a Buzz\Browser, use the Pinkfire\PinkfireBundle\Buzz\Client\PinkfireClientDecorator., (*9)

Log all the things !

Use the service pinkfire.request_aware.client to send everything you want:, (*10)

// ...
$client = $this->get('pinkfire.request_aware.client');
$client->push('message', 'level', ['my_context' => 'context'], ['link_1' => 'https://github.com/pinkfire/PinkfireBundle']);
$client->patch('message', 'level', ['my_context' => 'context updated'], ['link_1' => 'https://github.com/pinkfire/PinkfireBundle']);

The RequestAwareClient will automatically push/patch to the path and the channel of the master request., (*11)

The Versions

04/01 2017

dev-master

9999999-dev

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

guzzle buzz

04/01 2017

v2.1.0

2.1.0.0

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

guzzle buzz

04/01 2017

v2.0.0

2.0.0.0

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

02/10 2015

dev-feature/update_response

dev-feature/update_response

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

13/02 2015

dev-readme

dev-readme

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

12/02 2015

dev-url_blacklist

dev-url_blacklist

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

12/02 2015

v1.1.0

1.1.0.0

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

12/02 2015

dev-rpg600-patch-1

dev-rpg600-patch-1

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

24/01 2015

v1.0.1

1.0.1.0

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc

22/01 2015

v1.0.0

1.0.0.0

Debug application using Pinkfire

  Sources   Download

MIT

The Requires

 

by Avatar iamluc