Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
api/server: Server.CreateMux: pass context and use structured logs
Pass the context that's used for logging, and add minimal handling of context-cancellation. Also update logs to use structured fields. Before this patch: DEBU[2024-12-08T15:24:47.324420709Z] Registering POST, /networks/{id:.*}/disconnect DEBU[2024-12-08T15:24:47.324447251Z] Registering POST, /networks/prune DEBU[2024-12-08T15:24:47.324460626Z] Registering DELETE, /networks/{id:.*} With this patch: DEBU[2024-12-08T15:33:50.408445543Z] Registering route method=POST path="/networks/{id:.*}/disconnect" DEBU[2024-12-08T15:33:50.408484335Z] Registering route method=POST path=/networks/prune DEBU[2024-12-08T15:33:50.408505251Z] Registering route method=DELETE path="/networks/{id:.*}" Or in JSON format: {"level":"debug","method":"POST","msg":"Registering route","path":"/networks/{id:.*}/connect","time":"2024-12-08T15:37:19.235209667Z"} {"level":"debug","method":"POST","msg":"Registering route","path":"/networks/{id:.*}/disconnect","time":"2024-12-08T15:37:19.235243001Z"} {"level":"debug","method":"POST","msg":"Registering route","path":"/networks/prune","time":"2024-12-08T15:37:19.235290876Z"} Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Loading branch information