[PR #144] [MERGED] Add line break to logstash formatter #962

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

📋 Pull Request Information

Original PR: https://github.com/Seldaek/monolog/pull/144
Author: @gunnarlium
Created: 1/9/2013
Status: Merged
Merged: 1/10/2013
Merged by: @Seldaek

Base: masterHead: master


📝 Commits (1)

  • 71e9cf5 Add linebreak to end of logstash records.

📊 Changes

1 file changed (+1 additions, -1 deletions)

View changed files

📝 src/Monolog/Formatter/LogstashFormatter.php (+1 -1)

📄 Description

LogstashFormatter->format does not add a line break to the returned message. This causes every message to be put on the same line when logging to a StreamHandler.

This PR simply adds a line break after json_encode.

I'm not sure if this added line break affects other handlers, unit tests still pass.


🔄 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/144 **Author:** [@gunnarlium](https://github.com/gunnarlium) **Created:** 1/9/2013 **Status:** ✅ Merged **Merged:** 1/10/2013 **Merged by:** [@Seldaek](https://github.com/Seldaek) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`71e9cf5`](https://github.com/Seldaek/monolog/commit/71e9cf5626ab96b2b004bb6c4cca470fb2ed165d) Add linebreak to end of logstash records. ### 📊 Changes **1 file changed** (+1 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/Monolog/Formatter/LogstashFormatter.php` (+1 -1) </details> ### 📄 Description `LogstashFormatter->format` does not add a line break to the returned message. This causes every message to be put on the same line when logging to a `StreamHandler`. This PR simply adds a line break after `json_encode`. I'm not sure if this added line break affects other handlers, unit tests still pass. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 03:03:17 +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#962
No description provided.