http-proxy-middleware
http-proxy-middleware copied to clipboard
Configuration 'logLevel' flags being overwritten by LATEST configuration.
Is this a bug report?
Yes
Steps to reproduce
- Create multiple proxy configurations. For example:
const restProxy = proxy({
target: host.address,
pathRewrite: {
'^/rest-service/*' : '/'
},
logLevel: 'debug'
});
const reportProxy = proxy({
target: host.protocol + '://' + host.ip,
pathRewrite: {
'^/report-service/*' : '/'
},
logLevel: 'silent'
});
- Trigger the proxy middleware and notice that the
logLevel: 'debug'flag on your first configuration get ignored. Found that it was getting ignored by debugging Logger class, specifically _showLevel function.
Expected behavior
Should be able to set 'logLevel' per configuration. Noticed this happening on Angular-CLI/Webpack proxy as well. (not sure if related). I may be wrong in this assumption. In that case works correctly.
Actual behavior
Latest configuration loaded gets to decide 'logLevel'.
Setup
- "http-proxy-middleware": "^0.19.0"
- "express": "^4.16.2"
- node v8.12.0
- "@angular/cli": "^6.2.9"
client info
Windows 10 Enterprise Version 1809
target server info
Reproducible Demo
(Paste the link to an example project and exact instructions to reproduce the issue.)
I notice the same behaviour... Is there a timeline on this issue?
fixed in 3.0.0-beta