--- id: datadog-logger version: "1.0.3" license: MIT license_treatment: permissive maintenance: active --- # datadog-logger — Python logging handler for DataDog events License: permissive · Maintenance: active · Downloads: 449.4K/mo ## 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 above — 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 pip install datadog-logger uv add datadog-logger poetry add datadog-logger ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 449.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags datadog event logging, python logging handler datadog, send logs to datadog events, datadog event alerts, python datadog integration logging, datadog error event handler, logging to datadog events explorer, logging, datadog-integration, event-alerting [View on SkillFed](https://skillfed.io/packages/datadog-logger) · [View on PyPI](https://pypi.org/project/datadog-logger/)