mirror of
https://github.com/Seldaek/monolog.git
synced 2026-04-26 16:15:49 +03:00
[PR #326] [MERGED] GELF: Allow for both the legacy and the updated official library #1080
Labels
No labels
Bug
Documentation
Feature
Needs Work
Support
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/monolog#1080
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Seldaek/monolog/pull/326
Author: @bzikarsky
Created: 2/22/2014
Status: ✅ Merged
Merged: 2/23/2014
Merged by: @Seldaek
Base:
master← Head:gelf-php-compat📝 Commits (3)
c8289fdUpdated GelfHandler/GelfFormatterf0ed3d8Allow for both mlehner/gelf-php and graylog2/gelf-php usageb56ed7bMerge remote-tracking branch 'official/master' into gelf-php-compat📊 Changes
5 files changed (+175 additions, -35 deletions)
View changed files
📝
composer.json(+2 -2)📝
src/Monolog/Handler/GelfHandler.php(+19 -6)📝
tests/Monolog/Formatter/GelfMessageFormatterTest.php(+8 -3)➕
tests/Monolog/Handler/GelfHandlerLegacyTest.php(+95 -0)📝
tests/Monolog/Handler/GelfHandlerTest.php(+51 -24)📄 Description
Since https://github.com/Seldaek/monolog/pull/287 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:
GelfHandlerand replaced it with a runtime check for eitherIMessagePublisherorPublisherInterfaceGelfHandlerTestis quite dependent on the used GELF library. That's why I moved the tests for the legacy library to a separate fileGeldHandlerLegacyTestGelfFormatterTestfor an easy test with both librariescomposer.jsonnow defaults tograylog2/gelf-phpfor 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 tomlehner/gelf-php: ~1.0, and runcomposer update && phpunit. Better idea are very welcome!This enables users to switch to the current gelf-library by changing their
composer.jsontograylog2/gelf-phpand 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
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.