googleapis / nodejs-logging-winston

Node.js client integration between Stackdriver Logging and Winston.
https://cloud.google.com/logging/
Apache License 2.0
105 stars 50 forks source link

Skip writing RequestLogEntry for Cloud Run #793

Closed pebo closed 1 year ago

pebo commented 1 year ago

Cloud Run already adds request logs so with nodejs-logging-winston there's an additional log entry for each request.

The check for emitRequestLogEntry currently only checks for cloud functions and app engine.

https://github.com/googleapis/nodejs-logging-winston/blob/9b8657aa436787591c03717e1111117cda6687ee/src/middleware/express.ts#L83

Is your feature request related to a problem? Please describe. Request logs are duplicated with incurs uncessary cost and make the logs hard to read.,

Describe the solution you'd like Add GCPEnv.CLOUD_RUN to the emitRequestLogEntry check

Describe alternatives you've considered

Additional context

losalex commented 1 year ago

Thanks @pebo for opening this issue! It seems that proper solution for this problem described in 795, so I will close this one as duplicate. Please let me know if you have any other concerns.