Seldaek/monolog — pull request #326 by bzikarsky (2014-02-22 15:41:43+00:00)
Title: GELF: Allow for both the legacy and the updated official library

Since https://github.com/Seldaek/monolog/pull/287/files would have broken BC, this PR allows to use both the legacy GELF library (mlehner/gelf-php) and the official new one (graylog2/gelf-php) with Monolog.

Changes:

- Removed typehint in `GelfHandler` and replaced it with a runtime check for either `IMessagePublisher` or `PublisherInterface`
- The `GelfHandlerTest` is quite dependent on the used GELF library. That's why I moved the tests for the legacy library to a separate file `GeldHandlerLegacyTest`
- Introduced a feature-switch in `GelfFormatterTest` for an easy test with both libraries
- `composer.json` now defaults to `graylog2/gelf-php` for suggestion and require-dev. I cannot think of a way to automatically test for both the legacy and current library (naming clashes). To verify legacy-compatibility, one must manually change to `mlehner/gelf-php: ~1.0`, and run `composer update && phpunit`. Better idea are very welcome!

This enables users to switch to the current gelf-library by changing their `composer.json` to `graylog2/gelf-php` and does not change anything for users unwilling or unable to change. It should be able to introduce this PR in the next minor version.

/cc @h4cc