http-proxy-middleware icon indicating copy to clipboard operation
http-proxy-middleware copied to clipboard

Configuration 'logLevel' flags being overwritten by LATEST configuration.

Open jamesworkdesk opened this issue 7 years ago • 2 comments

Is this a bug report?

Yes

Steps to reproduce

  1. 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'
});
  1. 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.)

jamesworkdesk avatar Jul 10 '19 17:07 jamesworkdesk

I notice the same behaviour... Is there a timeline on this issue?

jasperkuperus avatar Apr 15 '21 12:04 jasperkuperus

fixed in 3.0.0-beta

chimurai avatar Apr 23 '22 18:04 chimurai