[PR #4425] [MERGED] Add HTTP request/response logging middleware for development mode #4619

Closed
opened 2026-02-22 18:36:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/4425
Author: @angelplusultra
Created: 9/22/2025
Status: Merged
Merged: 9/29/2025
Merged by: @timothycarambat

Base: masterHead: 4401-dev-http-logger


📝 Commits (7)

  • f510ed5 Add HTTP request logging middleware for development mode
  • de94fad Update httpLogger middleware to disable time logging by default
  • 8e2f1bf Add httpLogger middleware for development mode in collector service
  • 8fdfcbe Refactor httpLogger middleware to rename timeLogs parameter to enableTimestamps for clarity
  • da4ecf6 Make HTTP Logger only mount in development and environment flag is enabled.
  • 842adc1 Update .env.example to clarify HTTP Logger configuration comments
  • 3eb3f8b Merge branch 'master' into 4401-dev-http-logger

📊 Changes

7 files changed (+90 additions, -1 deletions)

View changed files

📝 collector/.env.example (+5 -0)
📝 collector/.gitignore (+3 -0)
📝 collector/index.js (+12 -0)
collector/middleware/httpLogger.js (+29 -0)
📝 server/.env.example (+6 -1)
📝 server/index.js (+12 -0)
server/middleware/httpLogger.js (+23 -0)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #4401

What is in this change?

This PR introduces an HTTP logging middleware layer in both express servers (/server and /collector) that logs:

  • The Request Method ( ex. GET)
  • The Request Path (ex. /workspace/my-workspace/stream-chat)
  • The Response Status Code (ex. 200)
  • An optional time log of the moment the response is sent.
image

With time log:

image

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 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/Mintplex-Labs/anything-llm/pull/4425 **Author:** [@angelplusultra](https://github.com/angelplusultra) **Created:** 9/22/2025 **Status:** ✅ Merged **Merged:** 9/29/2025 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `4401-dev-http-logger` --- ### 📝 Commits (7) - [`f510ed5`](https://github.com/Mintplex-Labs/anything-llm/commit/f510ed558e78569fa3a1842e3afd5e9e4ab22f9e) Add HTTP request logging middleware for development mode - [`de94fad`](https://github.com/Mintplex-Labs/anything-llm/commit/de94fad7aaa226e52249d329b46aecdc1ba7d9a8) Update httpLogger middleware to disable time logging by default - [`8e2f1bf`](https://github.com/Mintplex-Labs/anything-llm/commit/8e2f1bfb08c8a8095a234dc6c854cd3c32103207) Add httpLogger middleware for development mode in collector service - [`8fdfcbe`](https://github.com/Mintplex-Labs/anything-llm/commit/8fdfcbe27efdf3211e97cb0338b30a23322aecb8) Refactor httpLogger middleware to rename timeLogs parameter to enableTimestamps for clarity - [`da4ecf6`](https://github.com/Mintplex-Labs/anything-llm/commit/da4ecf6ec3fff10b68854c2c1629ee46631e80f0) Make HTTP Logger only mount in development and environment flag is enabled. - [`842adc1`](https://github.com/Mintplex-Labs/anything-llm/commit/842adc18abfd28da71218c7d9b720430b08f45c1) Update .env.example to clarify HTTP Logger configuration comments - [`3eb3f8b`](https://github.com/Mintplex-Labs/anything-llm/commit/3eb3f8bdba3bbb111b991d62b33fb13c8bc1c973) Merge branch 'master' into 4401-dev-http-logger ### 📊 Changes **7 files changed** (+90 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `collector/.env.example` (+5 -0) 📝 `collector/.gitignore` (+3 -0) 📝 `collector/index.js` (+12 -0) ➕ `collector/middleware/httpLogger.js` (+29 -0) 📝 `server/.env.example` (+6 -1) 📝 `server/index.js` (+12 -0) ➕ `server/middleware/httpLogger.js` (+23 -0) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [x] ✨ feat - [ ] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #4401 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> This PR introduces an HTTP logging middleware layer in both express servers (`/server` and `/collector`) that logs: - The Request Method ( ex. GET) - The Request Path (ex. /workspace/my-workspace/stream-chat) - The Response Status Code (ex. 200) - An optional time log of the moment the response is sent. <img width="422" height="18" alt="image" src="https://github.com/user-attachments/assets/eb39183f-08e9-4d23-9e3e-50e9d99e2053" /> With time log: <img width="483" height="17" alt="image" src="https://github.com/user-attachments/assets/f29954d4-e3fc-4cf0-a178-cbf8ba2b14c7" /> ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [ ] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:36:11 -05:00
yindo closed this issue 2026-02-22 18:36:11 -05:00
yindo changed title from [PR #4425] Add HTTP request/response logging middleware for development mode to [PR #4425] [MERGED] Add HTTP request/response logging middleware for development mode 2026-06-05 15:19:28 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#4619