Datadog logs logging handler and utilities.
- Python3.6 or higher
- pip
pip install ddlogs
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'})
- Source hosted at GitHub
- Report issues/questions/feature requests on GitHub Issues
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:
- Fork the repo
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Created and maintained by Masashi Terui (marcy9114@gmail.com)
MIT License (see LICENSE)