[19.0] endpoint_log: log endpoint calls in database with api_log
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with the open question of which repository should host the module, since that decides the dependency direction. Then read fastapi_log in OCA/rest-framework as the model for the bridge, and look at how ir.http._dispatch receives the functools.partial registered by endpoint_route_handler in web-api. Done means a maintainer has chosen the location and a bridge module logs endpoint calls to api.log, with the migration tracked in OCA/rest-framework#616.
由索引模型根据 Issue 内容生成。
描述
Endpoints currently leave no database record of the calls they receive. The log() helper available to code snippets writes manual messages to ir.logging, and nothing records the request and response themselves.
OCA/rest-framework already provides a generic model for this. api_log stores the URL, method, sanitised headers, body, status, timing and stack trace in api.log, and its api.log_collection.mixin adds a log switch and a Logs button to any model. fastapi_log is the bridge for fastapi.endpoint. The 19.0 migration is OCA/rest-framework#616.
I'd like to contribute an endpoint_log bridge for endpoint.endpoint, and I have a working version for 19.0:
endpoint.endpointinheritsapi.log_collection.mixin.- Logging hooks into
ir.http._dispatch, which receives thefunctools.partialthatendpoint_route_handlerregisters for each route. The endpoint record is resolved from it. The controller is not overridden, because routes call it by its dotted path. - Logs are written through a separate cursor, as in
fastapi_log, so the logs of failed calls are kept. api_logdepends only onweb, so the dependency stays light.
Question for maintainers: where should this module live?
- In web-api, depending on OCA/rest-framework for
api_log. - In rest-framework, next to
fastapi_log, depending on web-api forendpoint.
I'd lean towards web-api, since the module is about endpoints, but I'm happy to go either way.
@qrtl QT7417
Assisted-by: Claude Opus 5.5
- 主要语言
- Python
- 星标
- 49
- 派生
- 124
- 平均合并
- 4 天 13 小时
- 30 天内合并 PR
- 11
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OCA/web-api 的其他 Issue
-
bug
难度 3/5 1-2 天 新手友好度 55/100
维护者通常 1 天内回复
-
help wanted no stale work in progress
难度 3/5 1-2 天 新手友好度 45/100
维护者通常 1 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 22/100
维护者通常 1 天内回复
-
help wanted no stale work in progress
难度 3/5 1-2 天 新手友好度 50/100
维护者通常 1 天内回复
-
help wanted no stale work in progress
难度 4/5 3-5 天 新手友好度 25/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 65/100
StevenBlack/hosts#3299 ·
-
`garak --report` overwrites the input report when its name has no ".report"可能已有人在做 @0z5a 今天认领。 未关闭needs-triage
难度 2/5 半天 新手友好度 72/100
维护者通常 2 天内回复
-
plot_graph crashes when a mesh node has no m2m edge可能已有人在做 @tygvi 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
mllam/neural-lam#883 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
future-agi/future-agi#4092 · 1 条评论 ·
维护者通常 1 天内回复
-
transcript analytics: a text whose only protected spans the prose pass redacts is withheld whole未关闭
难度 1/5 1 小时以内 新手友好度 82/100
WingedGuardian/GENesis-AGI#4641 ·
维护者通常 1 天内回复