skillfed

django-datadog-logger

Django Datadog Logger integration package.

django-datadog-logger v0.9.1 265.6K downloads/30d#8,322 on PyPI25
Permissive license MIT Active released

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-logger

uv

uv add django-datadog-logger

poetry

poetry add django-datadog-logger

Installing 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

Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentFramework :: DjangoFramework :: Django :: 4.2Framework :: Django :: 5.2Framework :: Django :: 6.0Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

django datadog logging integrationrequest id tracking middlewarejson log formatter datadogdjango error logging middlewaredatadog trace context injectiondjango celery loggingstructured logging django
django-middlewareobservabilitystructured-logging

More Monitoring packages

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

opentelemetry-semantic-conventions

Provides generated Python code for…

permissive · top 100 on PyPI

opentelemetry-sdk

Provides the reference implementation of the…

permissive · top 100 on PyPI

opentelemetry-api

Provides the abstract API and interfaces for…

permissive · top 100 on PyPI

opentelemetry-exporter-otlp-proto-http

Exports OpenTelemetry observability data to an…

permissive · top 1,000 on PyPI

opentelemetry-instrumentation

Provides automatic instrumentation commands and…

permissive · top 1,000 on PyPI

ddtrace

ddtrace instruments Python applications to send…

permissive · top 1,000 on PyPI

django-log-formatter-asim

Formats Django application logs in Azure…

permissive · top 15,000 on PyPI

datadog-logger

Sends Python log messages to Datadog as Events…

permissive · top 15,000 on PyPI

django-request-id

Attaches a unique request ID to each Django…

permissive · top 15,000 on PyPI

safe-init

Safe Init wraps AWS Lambda handlers to provide…

permissive · top 15,000 on PyPI

django-structlog

Integrates structured logging into Django…

permissive · top 5,000 on PyPI

JSON-log-formatter

Formats Python logging records as JSON,…

permissive · top 5,000 on PyPI

django-log-request-id

Attaches a unique request ID to every log…

permissive · top 15,000 on PyPI

jsonformatter

Formats Python logging output as JSON, enabling…

permissive · top 15,000 on PyPI

json-logging

Configures Python's standard logging module to…

permissive · top 5,000 on PyPI