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

How to debug?

Open tomlarkworthy opened this issue 5 years ago • 3 comments

Hi I am trying to use the code in a serverless environment where I do not have control over the node VM arguments. How to I print out when the proxy request url and headers are?

Seems like you have the functionality in the trace debugging module, how to I get that to print to console.log? I am stuck doing surgery to proxyReq ATM, and its not at all obvious where the body and URL is.

tomlarkworthy avatar Dec 31 '18 16:12 tomlarkworthy

Hi @tomlarkworthy. Interesting.

The expected use is to set an environmental variable to trigger debug logging to stdout (what I think you mean by console.log).

DEBUG=express-http-proxy npm run YOUR_PROGRAM
DEBUG=express-http-proxy npm run YOUR_PROGRAM  | grep 'express-http-proxy'   # to filter down to just these messages

I think you are saying that in your environment, you can't set environmental variables? If this is correct, what kinds of messages can you send to the software? How would you like this to work?

Thanks

monkpow avatar Jan 01 '19 18:01 monkpow

@tomlarkworthy in can just set DEBUG=express-http-proxy as an environment variable to your serverless function. It's possible at least in Azure Functions and AWS Lambda.

emersonsoares avatar Jan 04 '19 03:01 emersonsoares

This documentation is terrible. Make it clear that this is setting an environment variable. So difficult to debug this

FirstVertex avatar Aug 23 '19 14:08 FirstVertex