[PR #61] [MERGED] added GelfHandler for sending log messages to Graylog2 #909

Closed
opened 2026-03-04 03:02:36 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/61
Author: @mlehner
Created: 2/23/2012
Status: Merged
Merged: 4/22/2012
Merged by: @Seldaek

Base: masterHead: gelf


📝 Commits (10+)

  • 0f5971c Merge pull request #1 from msabramo/gelf
  • 2a4fd11 added composer.lock to ignore, mlehner/gelf-php is now registered on packagist
  • b8e409d added require-dev block for tests, added proper description for suggested package
  • d551f34 removed un-needed autoload function
  • 979c465 created GelfMessageFormatter and related tests
  • 97b65bc contentPrefix should be contextPrefix
  • 07338af test injecting a GelfMessageFormatter with constructor arguments
  • a497704 write method should be protected, and protected methods after public methods
  • d95889a code cleanups as suggested by @stof
  • 7ffd390 add composer commands to travis config

📊 Changes

9 files changed (+299 additions, -107 deletions)

View changed files

📝 .gitignore (+2 -1)
📝 .travis.yml (+4 -0)
📝 composer.json (+4 -15)
composer.lock (+0 -11)
src/Monolog/Formatter/GelfMessageFormatter.php (+102 -0)
📝 src/Monolog/Handler/GelfHandler.php (+14 -64)
tests/Monolog/Formatter/GelfMessageFormatterTest.php (+150 -0)
📝 tests/Monolog/Handler/GelfHandlerTest.php (+22 -6)
📝 tests/bootstrap.php (+1 -10)

📄 Description

I created a GelfHandler for my own purposes, but decided to submit it back to the community since issue #18 has never been resolved.

This new GelfHandler requires my Gelf library published at https://github.com/mlehner/gelf-php.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Seldaek/monolog/pull/61 **Author:** [@mlehner](https://github.com/mlehner) **Created:** 2/23/2012 **Status:** ✅ Merged **Merged:** 4/22/2012 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `master` ← **Head:** `gelf` --- ### 📝 Commits (10+) - [`0f5971c`](https://github.com/Seldaek/monolog/commit/0f5971ce5a85383385a221002504d329e243d80b) Merge pull request #1 from msabramo/gelf - [`2a4fd11`](https://github.com/Seldaek/monolog/commit/2a4fd11998af97ddee680a200d7b44258795e43a) added composer.lock to ignore, mlehner/gelf-php is now registered on packagist - [`b8e409d`](https://github.com/Seldaek/monolog/commit/b8e409d307aea19927e4ec6b2cdd1fc9fbaaf6ee) added require-dev block for tests, added proper description for suggested package - [`d551f34`](https://github.com/Seldaek/monolog/commit/d551f340b8bb08ec2351aa040f94950e421a3c37) removed un-needed autoload function - [`979c465`](https://github.com/Seldaek/monolog/commit/979c4655f96cec438264961ce6708f5a0f9a03b2) created GelfMessageFormatter and related tests - [`97b65bc`](https://github.com/Seldaek/monolog/commit/97b65bc3e491b8c0841d3f4daaecfa9434e9607b) contentPrefix should be contextPrefix - [`07338af`](https://github.com/Seldaek/monolog/commit/07338af3236b59524ac2f73bc420085678e865c1) test injecting a GelfMessageFormatter with constructor arguments - [`a497704`](https://github.com/Seldaek/monolog/commit/a497704d949ed19cea7b9a0be5b45597d0c2288d) write method should be protected, and protected methods after public methods - [`d95889a`](https://github.com/Seldaek/monolog/commit/d95889a98d32a7f7cbfbb21ea5cadbe4aaf01eef) code cleanups as suggested by @stof - [`7ffd390`](https://github.com/Seldaek/monolog/commit/7ffd390c47528fbaabe9069fd3f89c2853c2cf57) add composer commands to travis config ### 📊 Changes **9 files changed** (+299 additions, -107 deletions) <details> <summary>View changed files</summary> 📝 `.gitignore` (+2 -1) 📝 `.travis.yml` (+4 -0) 📝 `composer.json` (+4 -15) ➖ `composer.lock` (+0 -11) ➕ `src/Monolog/Formatter/GelfMessageFormatter.php` (+102 -0) 📝 `src/Monolog/Handler/GelfHandler.php` (+14 -64) ➕ `tests/Monolog/Formatter/GelfMessageFormatterTest.php` (+150 -0) 📝 `tests/Monolog/Handler/GelfHandlerTest.php` (+22 -6) 📝 `tests/bootstrap.php` (+1 -10) </details> ### 📄 Description I created a GelfHandler for my own purposes, but decided to submit it back to the community since issue #18 has never been resolved. This new GelfHandler requires my Gelf library published at https://github.com/mlehner/gelf-php. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:02:36 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/monolog#909
No description provided.