router icon indicating copy to clipboard operation
router copied to clipboard

Customising logging is not possible need to build it with apollo router.

Open riginoommen opened this issue 8 months ago • 1 comments

2025-03-10T10:49:41.127864Z INFO trace_id: ea59560e18397fc195787bba089c035e span_id: a57fa9698cf3d3fe resource{service.version="1.59.2",service.namespace="apollo-router",process.executable.name="router",service.name="apollo-router",} router{http.route=/graphql,http.request.method=POST,} apollo-router/src/plugins/telemetry/config_new/events.rs:804 http.request.headers={"host": "localhost:4000", "connection": "keep-alive", "content-length": "1915", "sec-ch-ua-platform": "\"macOS\"", "authorization": "Bearer eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJiaTZWTjlMQV94S2J4QVZ.rsw.sdss", "user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36", "sec-ch-ua": "\"Not(A:Brand\";v=\"99\", \"Google Chrome\";v=\"133\", \"Chromium\";v=\"133\"", "content-type": "application/json", "sec-ch-ua-mobile": "?0", "accept": "*/*", "origin": "http://localhost:4000", "sec-fetch-site": "same-origin", "sec-fetch-mode": "cors", "sec-fetch-dest": "empty", "referer": "http://localhost:4000/graphql", "accept-encoding": "gzip, deflate, br, zstd", "accept-language": "en-GB,en-US;q=0.9,en;q=0.8"} http.request.method=POST http.request.uri=/graphql http.request.version=HTTP/1.1 http.request.body=Body(Streaming) kind=router.request

Above is the sample log for the apollo router i noticed taht authentication tokens are exposed in the log traces.

is there any way we can redact the sensitive data with the apollo router logs

riginoommen avatar Mar 10 '25 11:03 riginoommen

I think masking sensitive data in logs can be a good feature for the apollo router

riginoommen avatar May 26 '25 21:05 riginoommen