Skip to content

fix: reduce default HPM logging - #249

Merged
chenjiahan merged 2 commits into
mainfrom
chenjiahan/fix-hpm-default-logging
Aug 3, 2026
Merged

fix: reduce default HPM logging#249
chenjiahan merged 2 commits into
mainfrom
chenjiahan/fix-hpm-default-logging

Conversation

@chenjiahan

Copy link
Copy Markdown
Member

HTTP proxy middleware logs every successful proxied request at info, making the default dev-server output noisy. This change routes default HPM info messages through infrastructure log while preserving warnings, errors, and custom proxy loggers. Users can opt back in with infrastructureLogging.level: 'log' or 'verbose'.

Copilot AI review requested due to automatic review settings August 3, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR reduces default console noise from http-proxy-middleware (HPM) by downgrading HPM’s default “successful request” logging from infrastructure info to infrastructure log, while keeping warnings/errors and respecting any user-supplied proxy logger.

Changes:

  • Introduce a default proxy logger that routes HPM info messages through this.logger.log, preserving warn/error.
  • Keep custom proxy.logger behavior unchanged (only apply the default when proxyOptions.logger is undefined).
  • Add an E2E test suite validating default vs infrastructureLogging.level: 'log' behavior and custom logger preservation.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/server.ts Adds a defaultProxyLogger to reduce default HPM success-request logging verbosity while preserving warnings/errors and custom loggers.
tests/e2e/proxy-logging.test.js Adds E2E coverage to ensure successful proxy requests are not logged at default level, are logged at log level, and that custom proxy loggers still work.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@chenjiahan
chenjiahan merged commit 1785d71 into main Aug 3, 2026
3 checks passed
@chenjiahan
chenjiahan deleted the chenjiahan/fix-hpm-default-logging branch August 3, 2026 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants