--- id: django-datadog-logger version: "0.9.1" license: MIT license_treatment: permissive maintenance: active --- # django-datadog-logger — Django Datadog Logger integration package. License: permissive · Maintenance: active · Downloads: 265.6K/mo ## 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 above — 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 pip install django-datadog-logger uv add django-datadog-logger 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_current - Install friction: low - Maintenance: active - Downloads: 265.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags django datadog logging integration, request id tracking middleware, json log formatter datadog, django error logging middleware, datadog trace context injection, django celery logging, structured logging django, django-middleware, observability, structured-logging [View on SkillFed](https://skillfed.io/packages/django-datadog-logger) · [View on PyPI](https://pypi.org/project/django-datadog-logger/)