Skip to content

marcy-terui/ddlogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

a62ac1e · Nov 2, 2018

History

6 Commits
Nov 2, 2018
Oct 10, 2018
Oct 10, 2018
Oct 10, 2018
Oct 10, 2018
Oct 29, 2018
Oct 10, 2018

Repository files navigation

ddlogs

Version

Description

Datadog logs logging handler and utilities.

Requirements

  • Python3.6 or higher
  • pip

Installation

PyPI

pip install ddlogs

Usage

import logging
import ddlogs

logger = logging.getLogger('test')
h = ddlogs.DatadogLogsHandler(
    api_key='your-datadog-api-key',     # default: os.environ.get('DD_API_KEY')
    source_category='samplecategory',   # default: "ddlogs"
    source='samplesource',              # default: "python"
    service='sampleservice',            # default: logger.name
    host='localhost')                   # default: gethostname()
h.setFormatter(ddlogs.DictFormatter())
logger.addHandler(h)
logger.error({'foo': 'bar'})

Output

screenshot

Development

Pull requests are very welcome! Make sure your patches are well tested. Ideally create a topic branch for every separate change you make. For example:

  1. Fork the repo
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Authors

Created and maintained by Masashi Terui (marcy9114@gmail.com)

License

MIT License (see LICENSE)

About

Datadog Logs logging handler and utilities for Python

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages