fix: reduce default HPM logging - #249
Merged
Merged
Conversation
There was a problem hiding this comment.
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
infomessages throughthis.logger.log, preservingwarn/error. - Keep custom
proxy.loggerbehavior unchanged (only apply the default whenproxyOptions.loggerisundefined). - 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 infrastructurelogwhile preserving warnings, errors, and custom proxy loggers. Users can opt back in withinfrastructureLogging.level: 'log'or'verbose'.