diff --git a/.changeset/twenty-insects-live.md b/.changeset/twenty-insects-live.md new file mode 100644 index 0000000000..d3f8cdfc25 --- /dev/null +++ b/.changeset/twenty-insects-live.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-proxy-backend': patch +--- + +Ensure that `@backstage/plugin-proxy-backend` logs the requests that it proxies when log level is set to `debug`. diff --git a/plugins/proxy-backend/src/service/router.ts b/plugins/proxy-backend/src/service/router.ts index b669e82f3f..6912965659 100644 --- a/plugins/proxy-backend/src/service/router.ts +++ b/plugins/proxy-backend/src/service/router.ts @@ -121,6 +121,11 @@ export function buildMiddleware( // Attach the logger to the proxy config fullConfig.logProvider = () => logger; + // http-proxy-middleware uses this log level to check if it should log the + // requests that it proxies. Setting this to the most verbose log level + // ensures that it always logs these requests. Our logger ends up deciding + // if the logs are displayed or not. + fullConfig.logLevel = 'debug'; // Only return the allowed HTTP headers to not forward unwanted secret headers const requestHeaderAllowList = new Set(