(req, res, next)
| 52 | // Add logging field with trace ID for logging correlation |
| 53 | // For more info, see https://cloud.google.com/run/docs/logging#correlate-logs |
| 54 | const requestLogger = (req, res, next) => { |
| 55 | const traceHeader = req.header('X-Cloud-Trace-Context'); |
| 56 | let trace; |
| 57 | if (traceHeader) { |
| 58 | const [traceId] = traceHeader.split('/'); |
| 59 | trace = `projects/${project}/traces/${traceId}`; |
| 60 | } |
| 61 | req.logger = logger.child({'logging.googleapis.com/trace': trace}); |
| 62 | next(); |
| 63 | }; |
| 64 | |
| 65 | module.exports = { |
| 66 | authenticateJWT, |
nothing calls this directly
no outgoing calls
no test coverage detected