Skip to main content

Datadog-log

Write out JSON formatted logs in the format and with the attributes that Datadog expects

Installation

pip install datadog-log

Setup

The simplest way is to use init_logging() which will log to stdout.

If you want finner control then you can use DatadogFormatter directly. See init_logging for example usage.

Logging

Use logging as normal:

import logging
import datadoglog

datadoglog.init_logging()
log = logging.getLogger("example")
log.setLevel(logging.INFO)
log.info("Some info", extra={"extra": ["json"]})

The above would output json like below (but as a single line, shown 'pretty' here for readability):

{
  "message": "Some info",
  "extra": ["json"],
  "timestamp": "2021-09-18T21:14:07.707371+00:00",
  "status": "info",
  "logger": {
    "name": "example",
    "method_name": "<stdin>.<module>",
    "thread_name": "MainThread"
  }
}

Metadata

Release files for datadog-log 1.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for datadog-log 1.5.1
File Size Uploaded Provenance Actions
datadog_log-1.5.1.tar.gz 3.1 kB Without provenance Details for datadog_log-1.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for datadog-log 1.5.1
File Interpreter ABI Platform Actions
datadog_log-1.5.1-py3-none-any.whl Python 3 none any Details for datadog_log-1.5.1-py3-none-any.whl

Total release size: 7.1 kB

Release files / datadog_log-1.5.1.tar.gz

Download URL datadog_log-1.5.1.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ff73fe63a93202d2d52b64983bc2e4a15c79b5ef7e4a7462123021cec80b27fd
BLAKE2b-256 checksum
How to use checksums
5155cfbd758155a8986fc778150c3fcd28c6a45b2b740e93430bde4133dca278
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

Release files / datadog_log-1.5.1-py3-none-any.whl

Download URL datadog_log-1.5.1-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
860388819048234aa217d8f7da3ca635a2894c2bfa16e0f0319332eb27955970
BLAKE2b-256 checksum
How to use checksums
81462ace21d29964d2bf27784cc91b1799a7d7117f4d442519286c2c636ab873
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.3 CPython/3.12.4 Darwin/23.5.0

Security for datadog-log 1.5.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page