[PR #685] [MERGED] Add fluentd formatter. #1295

Closed
opened 2026-03-04 03:08:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/685
Author: @fordnox
Created: 11/15/2015
Status: Merged
Merged: 11/18/2015
Merged by: @Seldaek

Base: masterHead: master


📝 Commits (3)

  • a5552dd Add fluentd formatter.
  • 6abfc22 Fix Fluentd array notation to support older PHP versions
  • 034e895 Do not include message levels if it is already included in tag

📊 Changes

2 files changed (+151 additions, -0 deletions)

View changed files

src/Monolog/Formatter/FluentdFormatter.php (+91 -0)
tests/Monolog/Formatter/FluentdFormatterTest.php (+60 -0)

📄 Description

Serializes a log message to Fluentd unix socket protocol.

Fluentd config:

<source>
   type unix
   path /var/run/td-agent/td-agent.sock
</source>

Monolog setup:

 $logger = new Monolog\Logger('fluent.tag');
 $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock');
 $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter());
 $logger->pushHandler($fluentHandler);

🔄 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/685 **Author:** [@fordnox](https://github.com/fordnox) **Created:** 11/15/2015 **Status:** ✅ Merged **Merged:** 11/18/2015 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (3) - [`a5552dd`](https://github.com/Seldaek/monolog/commit/a5552dd34d9493cc18ba443d773de709842ebf8d) Add fluentd formatter. - [`6abfc22`](https://github.com/Seldaek/monolog/commit/6abfc2276256a20bb57453c81a44fd3df13a35b9) Fix Fluentd array notation to support older PHP versions - [`034e895`](https://github.com/Seldaek/monolog/commit/034e895a6dd682de4298960dd7c4218f5cc7e901) Do not include message levels if it is already included in tag ### 📊 Changes **2 files changed** (+151 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `src/Monolog/Formatter/FluentdFormatter.php` (+91 -0) ➕ `tests/Monolog/Formatter/FluentdFormatterTest.php` (+60 -0) </details> ### 📄 Description Serializes a log message to Fluentd unix socket protocol. Fluentd config: ``` <source> type unix path /var/run/td-agent/td-agent.sock </source> ``` Monolog setup: ``` php $logger = new Monolog\Logger('fluent.tag'); $fluentHandler = new Monolog\Handler\SocketHandler('unix:///var/run/td-agent/td-agent.sock'); $fluentHandler->setFormatter(new Monolog\Formatter\FluentdFormatter()); $logger->pushHandler($fluentHandler); ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:08:59 +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#1295
No description provided.