functions-framework-nodejs icon indicating copy to clipboard operation
functions-framework-nodejs copied to clipboard

Serving Function... logs in GCP

Open ak--47 opened this issue 1 year ago • 2 comments

i have noticed that when deploying my function, the Serving Function... console output shows in GCP logs: verbose msg

i would expect that message if I'm running functions-framework locally, but i would not expect it inside GCP... why does this extra come up? is there a way to suppress it?

here's my deploy command, in case i am doing something irregular:

gcloud alpha functions deploy my-func --gen2 --no-allow-unauthenticated --env-vars-file .env.yaml --runtime nodejs20 --region us-central1 --trigger-http --memory 4GB --entry-point entry --source ./dist/myapp/

ak--47 avatar Jul 19 '24 05:07 ak--47

I have the opposite issue, I would like to see logs while running it locally 😒 how did you make it do it?

FezVrasta avatar Aug 08 '24 14:08 FezVrasta

i'm mystified; i've only ever seen this on my local; never on cloud logger.

ak--47 avatar Aug 16 '24 02:08 ak--47

fwiw, i found the answer:

https://github.com/GoogleCloudPlatform/functions-framework-nodejs/blob/28b1c300240771720f70a95522ede7ce6a2ccea0/src/main.ts#L63

turns out it was environment variables. (when its not DNS, it's environment variables)

if NODE_ENV is set to production (exactly) you don't see the localhost message. should have just looked at the source code 🙈

ak--47 avatar Dec 02 '24 19:12 ak--47