feat: API request/response logging with admin log viewer
- Add api_logs table (migration 0007) and ApiLog model - Add web/lib/api_logger.py — httpx wrapper that records every outbound call - Wire api_logger into vk_sync, vk_catalog, and connections test endpoints - Add /admin/logs page with filters (service, method, status, time range, URL search) and expandable request/response detail - Add "Логи" nav link for admin users Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -38,6 +38,7 @@ from web.routes.admin import router as admin_router # noqa: E402
|
||||
from web.routes.catalog import router as catalog_router # noqa: E402
|
||||
from web.routes.connections import router as connections_router # noqa: E402
|
||||
from web.routes.vk_catalog import router as vk_catalog_router # noqa: E402
|
||||
from web.routes.logs import router as logs_router # noqa: E402
|
||||
|
||||
app.include_router(auth_router)
|
||||
app.include_router(reset_router)
|
||||
@@ -48,6 +49,7 @@ app.include_router(admin_router)
|
||||
app.include_router(catalog_router)
|
||||
app.include_router(connections_router)
|
||||
app.include_router(vk_catalog_router)
|
||||
app.include_router(logs_router)
|
||||
|
||||
|
||||
# ── Catalog redirect ─────────────────────────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user