datadog-logger
Python logging handler for DataDog events
What it is and what it does
Datadog Logger is a Python logging handler that bridges the standard logging module to Datadog's Events Explorer. Instead of sending logs to Datadog's Log Management product (which requires separate configuration), this handler converts log records into Datadog events, allowing you to surface ERROR and higher-level messages as discrete events that can be tagged, mentioned, and alerted on.
You configure it by either calling the convenience function `log_error_events()` on the root logger or manually instantiating `DatadogLogHandler` and adding it to specific loggers. The handler converts the log message into an event title, includes the full formatted record (and stack trace if present) as event text, and appends any mentions you specify. It requires only the datadog package as a dependency and supports Python 3.10 and later.
Use it for:
- Alert on application errors by sending ERROR and CRITICAL logs as Datadog events tagged for your team.
- Route specific logger output to Datadog events while keeping other logs local or in a separate system.
- Notify Slack or other integrations via Datadog mentions when critical log events occur.
- Track exceptions with full stack traces as discrete events in Datadog's Events Explorer.
- Add custom tags to log-based events for filtering and correlation in Datadog dashboards.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Sends Python log messages to Datadog as Events in the Events Explorer via a custom logging.Handler, with support for tags and mentions.
Yes, if you use Datadog and want to surface application errors as events in the Events Explorer with minimal setup. The single dependency, permissive license, and active maintenance make it a low-friction choice. Not suitable if you need Datadog's Log Management product or log aggregation beyond event creation.
Install
datadog-logger on PyPI
pip
pip install datadog-loggeruv
uv add datadog-loggerpoetry
poetry add datadog-loggerInstalling datadog-logger
Before you install
Low install friction with a single runtime dependency on datadog. Package is actively maintained with a recent release.
License in practice
MIT license permits commercial and private use with minimal restrictions.
Quickstart
pip install datadog-logger
import datadog
from datadog_logger import log_error_events
import logging
datadog.initialize(api_key="api-key", app_key="app-key")
logging.basicConfig()
log_error_events(tags=["tag1:value"], mentions=["@devs"])
logging.error("Oh no!")
Requires Datadog API credentials (api_key and app_key) and Python 3.10 or later.
Verify before relying
- Whether the package works with Datadog's newer Log Management product or only with the Events Explorer as documented.
- Performance characteristics when logging high volumes of events to Datadog.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — datadog |
| Maintenance | actively maintained — 18 days since the last release |
| First released | |
| Downloads | 449,443/month — #6,595 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: datadog_logger-1.0.3-py3-none-any.whl
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
datadogProvides a Python client library to send…
permissive · top 1,000 on PyPI
mdcAdds Mapped Diagnostic Context (MDC) support to…
unclear · top 15,000 on PyPI
fluent-loggerSends structured event logs from Python…
unclear · top 5,000 on PyPI
django-datadog-loggerIntegrates Django applications with Datadog…
permissive · top 15,000 on PyPI
seqlogSeqLog sends Python log records to Seq, a…
permissive · top 15,000 on PyPI
Flask-DatadogFlask-Datadog provides a Flask extension to…
permissive · top 15,000 on PyPI
multiprocessing-loggingProvides a logging handler that tunnels log…
copyleft · top 15,000 on PyPI
cloudwatchA Python logging handler that sends log events…
permissive · top 15,000 on PyPI
python-logging-lokiA Python logging handler that sends log records…
permissive · top 5,000 on PyPI
safe-initSafe Init wraps AWS Lambda handlers to provide…
permissive · top 15,000 on PyPI