drf-api-logger
The production standard for DRF API observability: request/response logging, profiling, masking, and admin analytics.
Decision gist · record as of 2026-08-14
Yes. The package is actively maintained, has low install friction, carries no security vulnerabilities, and solves a real problem—comprehensive API observability without custom middleware. It's suitable for production Django REST Framework deployments that need request/response logging, sensitive-data masking, and admin analytics. The only gotcha is planning the database migration carefully on large MySQL/MariaDB tables.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Django 4.2+, Django REST Framework 3.16+, and Python 3.10+.
- On large MySQL/MariaDB tables, the 1.2.0+ migration adding profiling columns may require manual schema management.
- Low friction: pure Python wheel, three runtime dependencies (Django, djangorestframework, bleach), and actively maintained with a release 37 days ago.
License · maintenance · safety
Apache-2.0 (permissive) — Apache-2.0 is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
last release 2026-07-08 (37 days) · last repo commit 2026-07-24 · 344 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 86,318 downloads/mo, #13,872 on PyPI
Alternatives
Verify before relying
pip install drf-api-logger
# settings.py
INSTALLED_APPS = ['drf_api_logger']
MIDDLEWARE = ['drf_api_logger.middleware.api_logger_middleware.APILoggerMiddleware']
DRF_API_LOGGER_DATABASE = True
DRF_API_LOGGER_EXCLUDE_KEYS = ['password', 'token', 'secret']
# then: python manage.py migrate- Whether the background worker queue has configurable limits or backpressure handling under high request volume.
- Whether signal-based logging can coexist with database logging or if they are mutually exclusive.
- Performance overhead of profiling mode on typical production workloads.
What it is and what it does
DRF API Logger is a Django middleware that automatically captures incoming and outgoing API metadata—URL, method, headers, body, status code, client IP, and execution time—for every request handled by Django REST Framework. It masks sensitive keys like passwords and tokens with ***FILTERED***, stores logs asynchronously to avoid blocking request threads, and surfaces them in Django admin with search, filtering, charts, and optional SQL profiling. The package is designed to replace fragile custom logging middleware with a production-ready observability layer that works in both sync and async Django deployments.
The middleware can log to a database for admin visibility and analytics, emit real-time signals for custom integrations, or both. It supports request correlation via trace IDs, payload size limits to prevent unbounded storage, and optional per-endpoint policies for masking and filtering. The admin interface shows slow APIs, execution times, and profiling diagnostics when enabled, making it straightforward to identify performance bottlenecks without writing custom instrumentation.
Use it for
- Debug slow or failing API endpoints by inspecting request/response bodies and execution times in Django admin without custom middleware.
- Mask sensitive credentials automatically across all DRF endpoints to meet compliance and security audit requirements.
- Profile SQL-heavy endpoints to detect N+1 queries and middleware overhead without adding manual instrumentation.
- Export API logs as CSV or integrate with analytics services via real-time signals for custom observability pipelines.
- Track API performance trends and anomalies using built-in admin charts and filtering by status code, method, and date range.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is actively maintained, has low install friction, carries no security vulnerabilities, and solves a real problem—comprehensive API observability without custom middleware. It's suitable for production Django REST Framework deployments that need request/response logging, sensitive-data masking, and admin analytics. The only gotcha is planning the database migration carefully on large MySQL/MariaDB tables.
Install
drf-api-logger on PyPI
Before you install
Low friction: pure Python wheel, three runtime dependencies (Django, djangorestframework, bleach), and actively maintained with a release 37 days ago. No compiled dependencies or complex setup.
Requires Django 4.2+, Django REST Framework 3.16+, and Python 3.10+. On large MySQL/MariaDB tables, the 1.2.0+ migration adding profiling columns may require manual schema management.
License in practice
Apache-2.0 is permissive; you can use, modify, and distribute this package freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install drf-api-logger
# settings.py
INSTALLED_APPS = ['drf_api_logger']
MIDDLEWARE = ['drf_api_logger.middleware.api_logger_middleware.APILoggerMiddleware']
DRF_API_LOGGER_DATABASE = True
DRF_API_LOGGER_EXCLUDE_KEYS = ['password', 'token', 'secret']
# then: python manage.py migrate
Verify before relying
- Whether the background worker queue has configurable limits or backpressure handling under high request volume.
- Whether signal-based logging can coexist with database logging or if they are mutually exclusive.
- Performance overhead of profiling mode on typical production workloads.
Package facts
| License | Apache-2.0 permissive |
| Python support | Supports the current Python release >=3.10 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagesDjangodjangorestframeworkbleach |
| Maintenance | Actively maintained 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 86,318 / month, #13,872 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Framework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.0Framework :: Django :: 5.1Framework :: Django :: 5.2Framework :: Django :: 6.0Operating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python Modules |
Evidence: drf_api_logger-1.4.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “django rest framework api logging”
- drf-api-loggerCaptures and logs Django REST Framework API requests and responses…
- djangorestframework-api-keyProvides API key authentication and permission control for Django…
- django-rest-swaggerGenerates Swagger UI documentation and OpenAPI JSON schemas for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also django-easy-audit · django-request-logging · drf-exceptions-hog · django-silk · django-querycount · django-guid · djangorestframework · drf-standardized-errors · djangorestframework-queryfields · djangorestframework-api-key