django-datadog-logger
Django Datadog Logger integration package.
What it is and what it does
Django Datadog Logger is a middleware and formatter package that bridges Django applications with Datadog's logging infrastructure. It provides three core pieces: request ID middleware for tracking requests across logs, error and request logging middleware to capture HTTP lifecycle events, and a JSON formatter that outputs logs in Datadog-compatible format with automatic trace context injection when ddtrace is configured.
The package is designed to work alongside Django REST Framework and integrates with Celery for task logging. It allows you to configure separate log files for different concerns (application, state, request, session, error) and automatically injects Datadog trace IDs and span IDs into log records when ddtrace patching is enabled. Configuration is done through Django's standard LOGGING dictionary, making it fit naturally into existing Django setups.
Use it for:
- Set up centralized JSON logging in a Django application for ingestion into Datadog monitoring.
- Track HTTP requests across distributed systems using request ID middleware and trace context.
- Separate application, error, and request logs into distinct files with structured JSON output.
- Integrate Celery task logging with Datadog tracing for end-to-end observability.
- Inject Datadog trace and span IDs into logs automatically when using ddtrace instrumentation.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Integrates Django applications with Datadog logging by providing middleware for request tracking, error logging, and JSON-formatted log output compatible with Datadog's ingestion.
Yes. The package is actively maintained, has no known vulnerabilities, low install friction, and a permissive MIT license. It directly solves the problem of integrating Django logging with Datadog and is well-suited for teams already using Datadog for observability. Install it if you need structured logging in Django with Datadog compatibility; skip it if you use a different observability platform or don't need JSON-formatted logs.
Install
django-datadog-logger on PyPI
pip
pip install django-datadog-loggeruv
uv add django-datadog-loggerpoetry
poetry add django-datadog-loggerInstalling django-datadog-logger
Before you install
Low friction install with three straightforward runtime dependencies (django, djangorestframework, json-log-formatter). Package is actively maintained with a recent release 37 days ago and no known vulnerabilities.
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install django-datadog-logger
# In Django settings.py MIDDLEWARE:
MIDDLEWARE = [
"django_datadog_logger.middleware.request_id.RequestIdMiddleware",
# ...
"django_datadog_logger.middleware.error_log.ErrorLoggingMiddleware",
"django_datadog_logger.middleware.request_log.RequestLoggingMiddleware",
]
# In LOGGING formatters:
from django_datadog_logger.formatters.datadog import DatadogJSONFormatter
formatter = DatadogJSONFormatter()
Requires Python 3.10 or later; Django 4.2, 5.2, or 6.0.
Verify before relying
- Whether ddtrace integration requires ddtrace library to be installed separately or if it's optional.
- Performance impact of request ID tracking and JSON formatting on high-throughput applications.
- Compatibility with non-Datadog logging backends or whether it's tightly coupled to Datadog.
- Whether Celery integration works with all Celery versions or has specific version constraints.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — django, djangorestframework, json-log-formatter |
| Maintenance | actively maintained — 37 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 265,603/month — #8,322 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: django_datadog_logger-0.9.1-py3-none-any.whl
Keywords: django_datadog_logger
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
ddtraceddtrace instruments Python applications to send…
permissive · top 1,000 on PyPI
django-log-formatter-asimFormats Django application logs in Azure…
permissive · top 15,000 on PyPI
datadog-loggerSends Python log messages to Datadog as Events…
permissive · top 15,000 on PyPI
django-request-idAttaches a unique request ID to each Django…
permissive · top 15,000 on PyPI
safe-initSafe Init wraps AWS Lambda handlers to provide…
permissive · top 15,000 on PyPI
django-structlogIntegrates structured logging into Django…
permissive · top 5,000 on PyPI
JSON-log-formatterFormats Python logging records as JSON,…
permissive · top 5,000 on PyPI
django-log-request-idAttaches a unique request ID to every log…
permissive · top 15,000 on PyPI
jsonformatterFormats Python logging output as JSON, enabling…
permissive · top 15,000 on PyPI
json-loggingConfigures Python's standard logging module to…
permissive · top 5,000 on PyPI